diff options
author | Robert Brewer <fumanchu@aminus.org> | 2006-06-26 04:15:51 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2006-06-26 04:15:51 +0000 |
commit | 2ef575bc240b40f7cc37d1b56716ee70bcb9c8dc (patch) | |
tree | 55a29315c0d73d89434f0ecd770adb77a366167b | |
parent | b453bacd1670cc6088afc65bf1e701ea3fe541da (diff) | |
download | cherrypy-git-2ef575bc240b40f7cc37d1b56716ee70bcb9c8dc.tar.gz |
Fix for #475 (double calling acquire_lock() freezes the request).
-rw-r--r-- | cherrypy/lib/sessions.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cherrypy/lib/sessions.py b/cherrypy/lib/sessions.py index 4d53afcc..318edaa0 100644 --- a/cherrypy/lib/sessions.py +++ b/cherrypy/lib/sessions.py @@ -235,9 +235,10 @@ class FileStorage: f.close() def acquire_lock(self): - file_path = self._get_file_path(cherrypy.session.id) - self._lock_file(file_path + self.LOCK_SUFFIX) - cherrypy.request._session.locked = True + if not cherrypy.request._session.locked: + file_path = self._get_file_path(cherrypy.session.id) + self._lock_file(file_path + self.LOCK_SUFFIX) + cherrypy.request._session.locked = True def release_lock(self): file_path = self._get_file_path(cherrypy.session.id) |