From 4a138cb8273e6a2078c0144ae592af81f563f71f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 Nov 2015 22:17:45 +1300 Subject: Fix refresh async session issue --- src/org/traccar/web/AsyncServlet.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/web/AsyncServlet.java b/src/org/traccar/web/AsyncServlet.java index 73803ab91..a96a64381 100644 --- a/src/org/traccar/web/AsyncServlet.java +++ b/src/org/traccar/web/AsyncServlet.java @@ -50,7 +50,7 @@ public class AsyncServlet extends BaseServlet { public static class AsyncSession { - private static final boolean DEBUG_ASYNC = false; + private static final boolean DEBUG_ASYNC = true; private static final long SESSION_TIMEOUT = 30; private static final long REQUEST_TIMEOUT = 20; @@ -114,7 +114,9 @@ public class AsyncServlet extends BaseServlet { } Context.getConnectionManager().removeListener(devices, dataListener); synchronized (ASYNC_SESSIONS) { - ASYNC_SESSIONS.remove(userId); + if (ASYNC_SESSIONS.get(userId) == AsyncSession.this) { + ASYNC_SESSIONS.remove(userId); + } } } }; -- cgit v1.2.3