aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index da8060071..ac1d450c5 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -51,6 +51,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private FilterHandler filterHandler;
private DistanceHandler distanceHandler;
+ private RemoteAddressHandler remoteAddressHandler;
private MotionHandler motionHandler;
private GeocoderHandler geocoderHandler;
private GeolocationHandler geolocationHandler;
@@ -132,6 +133,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
Context.getConfig().getInteger("coordinates.minError"),
Context.getConfig().getInteger("coordinates.maxError"));
+ if (Context.getConfig().getBoolean("processing.remoteAddress.enable")) {
+ remoteAddressHandler = new RemoteAddressHandler();
+ }
+
if (Context.getConfig().getBoolean("filter.enable")) {
filterHandler = new FilterHandler();
}
@@ -202,7 +207,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("distance", distanceHandler);
}
- pipeline.addLast("remoteAddress", new RemoteAddressHandler());
+ if (remoteAddressHandler != null) {
+ pipeline.addLast("remoteAddress", remoteAddressHandler);
+ }
addDynamicHandlers(pipeline);