Commits

Remi Delon  committed 023e5ac

Fixed #313 (when favicon.ico was being served, the session wasn't released because the machinery was being bypassed)

  • Participants
  • Parent commits 89eeeda

Comments (0)

Files changed (2)

File cherrypy/_cphttptools.py

             # that raises NotFound.
             icofile = os.path.join(os.path.dirname(__file__), "favicon.ico")
             cptools.serveFile(icofile)
+            applyFilters('beforeFinalize')
             finalize()
             raise cherrypy.RequestHandled()
         else:

File cherrypy/lib/filter/sessionfilter.py

     
     def _clean(self, sess):
         if getattr(sess, 'locked', None):
-            # If the session is still locked there probably was an
-            #   error while processing the request.
-            #   In that case we release the lock anyway.
+            # If the session is still locked we release the lock
             sess.sessionStorage.releaseLock()
         if getattr(sess, 'sessionStorage', None):
             del sess.sessionStorage
                 break
             if time.time() - startTime > sess.deadlockTimeout:
                 raise SessionDeadlockError()
+            time.sleep(0.5)
         sess.locked = True
     
     def releaseLock(self):