From 901bcf5da82eb7d1370856ceb732397e8ef4c670 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 21 Aug 2017 00:32:38 +1200 Subject: Do not save IP by default --- src/org/traccar/BasePipelineFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/org') 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); -- cgit v1.2.3