Commits

Anonymous committed 07cc8ec

logdebuginfofilter no longer prints sessionMap size, this fixes a bug where sessions contain unpicklable objects, and it isn\'t as meaningfull with the new sessionFilter

  • Participants
  • Parent commits b6f72e5

Comments (0)

Files changed (3)

cherrypy/lib/filter/logdebuginfofilter.py

             if cpg.config.get('logDebugInfoFilter.logPageSize', True):
                 logList.append("Page size: %.02fKB" % (
                     len(body)/float(1024)))
-            
+            ''' 
+            # this is not compatible with the session filter
             if (cpg.config.get('logDebugInfoFilter.logSessionSize', True)
                 and cpg.config.get('session.storageType')):
                 # Pickle session data to get its size
                                    (len(dumpStr) / float(1024)))
                 except:
                     logList.append("Session data size: Unable to pickle session")
+            '''
             
             debuginfo += ', '.join(logList)
             if logAsComment:

cherrypy/lib/filter/sessionfilter/sqlobjectsession.py

     def __getattr__(self, attr):
         if attr in ['timestamp', 'timeout', 'lastAccess', 'key']:
             return getattr(self.__sqlObject, self.__attrSub(attr))
+        else:
+            return object.__getattr__(self, attr)
 
     def __setattr__(self, attr, value):
         if attr == 'key' or attr == 'timestamp':
     
     def cleanUpOldSessions(self):
         # running a single query would be a huge performace boost
-        for sessionKey in __data:
-            session = sessionData[sessionKey]
-            if session.expired():
-                self.delSession(sessionKey)
-
-'''
-Session.createTable()
-p = Session(session_key = 'abcd', timestamp = 330, count = 123)
-Session.delete(Session.q.session_key=='abcd')
-
-smanage = SQLObjectSession('test')
-print smanage.getSession('abcd')
-'''
+        pass

cherrypy/test/test_logdebuginfo_filter.py

         helper.request('/')
         self.assert_('Build time' in cpg.response.body)
         self.assert_('Page size' in cpg.response.body)
-        self.assert_('Session data size' in cpg.response.body)
+        # not compatible with the sessionFilter
+        #self.assert_('Session data size' in cpg.response.body)
 
 
 if __name__ == "__main__":