Commit 3d120237 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Small fixes for inactivity timeout

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@5822 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5fc3f213
...@@ -116,9 +116,7 @@ public class HttpSessionManager { ...@@ -116,9 +116,7 @@ public class HttpSessionManager {
sessionMap.put(streamID.getID(), session); sessionMap.put(streamID.getID(), session);
session.addSessionCloseListener(new SessionListener() { session.addSessionCloseListener(new SessionListener() {
public void connectionOpened(HttpSession session, HttpConnection connection) { public void connectionOpened(HttpSession session, HttpConnection connection) {
if (session instanceof HttpSession) {
timer.stop(session); timer.stop(session);
}
} }
public void connectionClosed(HttpSession session, HttpConnection connection) { public void connectionClosed(HttpSession session, HttpConnection connection) {
...@@ -128,7 +126,7 @@ public class HttpSessionManager { ...@@ -128,7 +126,7 @@ public class HttpSessionManager {
} }
public void sessionClosed(HttpSession session) { public void sessionClosed(HttpSession session) {
sessionMap.remove(session.getStreamID()); sessionMap.remove(session.getStreamID().getID());
timer.stop(session); timer.stop(session);
} }
}); });
...@@ -199,7 +197,7 @@ public class HttpSessionManager { ...@@ -199,7 +197,7 @@ public class HttpSessionManager {
= new HashMap<String, InactivityTimeoutTask>(); = new HashMap<String, InactivityTimeoutTask>();
public void stop(HttpSession session) { public void stop(HttpSession session) {
InactivityTimeoutTask task = sessionMap.remove(session.getStreamID()); InactivityTimeoutTask task = sessionMap.remove(session.getStreamID().getID());
if(task != null) { if(task != null) {
task.cancel(); task.cancel();
} }
...@@ -225,6 +223,7 @@ public class HttpSessionManager { ...@@ -225,6 +223,7 @@ public class HttpSessionManager {
public void run() { public void run() {
session.close(); session.close();
timer.sessionMap.remove(session.getStreamID().getID());
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment