Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1501

Show
Ignore:
Timestamp:
12/09/06 17:37:12
Author:
fumanchu
Message:

2.x Fix for #475 (double calling acquire_lock() freezes the request). Fix is for file sessions only, and is a backport of [1162].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/filters/sessionfilter.py

    r1174 r1501  
    283283    def acquire_lock(self): 
    284284        sess = cherrypy.request._session 
     285        if not sess.locked: 
     286            file_path = self._get_file_path(cherrypy.session.id) 
     287            self._lock_file(file_path + self.LOCK_SUFFIX) 
     288            sess.locked = True 
     289     
     290    def release_lock(self): 
     291        sess = cherrypy.request._session 
    285292        file_path = self._get_file_path(cherrypy.session.id) 
    286         lock_file_path = file_path + self.LOCK_SUFFIX 
    287         self._lock_file(lock_file_path) 
    288         sess.locked = True 
    289      
    290     def release_lock(self): 
    291         sess = cherrypy.request._session 
    292         file_path = self._get_file_path(cherrypy.session.id) 
    293         lock_file_path = file_path + self.LOCK_SUFFIX 
    294         self._unlock_file(lock_file_path) 
     293        self._unlock_file(file_path + self.LOCK_SUFFIX) 
    295294        sess.locked = False 
    296295     

Hosted by WebFaction

Log in as guest/cpguest to create tickets