# HG changeset patch # User Sylvain Thénault # Date 1309443985 -7200 # Node ID d3459fe041f0f893a61a661933ab19f4a79e1970 # Parent c7c0f53062f55db532ca0e6009b6b7199e610345 [web session] fix bad cleanup of session without a connection set. Closes #1772125 diff -r c7c0f53062f5 -r d3459fe041f0 dbapi.py --- a/dbapi.py Thu Jun 30 08:27:56 2011 +0200 +++ b/dbapi.py Thu Jun 30 16:26:25 2011 +0200 @@ -241,6 +241,7 @@ self.cnx = cnx self.data = {} self.login = login + self.mtime = time() # dbapi session identifier is the same as the first connection # identifier, but may later differ in case of auto-reconnection as done # by the web authentication manager (in cw.web.views.authentication) diff -r c7c0f53062f5 -r d3459fe041f0 web/application.py --- a/web/application.py Thu Jun 30 08:27:56 2011 +0200 +++ b/web/application.py Thu Jun 30 16:26:25 2011 +0200 @@ -71,6 +71,8 @@ total += 1 try: last_usage_time = session.cnx.check() + except AttributeError: + last_usage_time = session.mtime except BadConnectionId: self.close_session(session) closed += 1 @@ -228,7 +230,9 @@ self.session_manager.close_session(session) def get_session(self, req, sessionid): - return self.session_manager.get_session(req, sessionid) + session = self.session_manager.get_session(req, sessionid) + session.mtime = time() + return session def open_session(self, req, allow_no_cnx=True): session = self.session_manager.open_session(req, allow_no_cnx=allow_no_cnx)