Changeset 261
- Timestamp:
- 06/09/05 19:00:23
- Files:
-
- branches/ticket-177/cherrypy/_cpserver.py (modified) (4 diffs)
- branches/ticket-177/cherrypy/lib/filter/sessionfilter.py (modified) (1 diff)
- branches/ticket-177/cherrypy/lib/profiler.py (added)
- branches/ticket-177/cherrypy/test/test.py (modified) (1 diff)
- branches/ticket-177/cherrypy/test/test_core.py (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/ticket-177/cherrypy/_cpserver.py
r243 r261 35 35 import time 36 36 import sys 37 import cpg, _cputil, _cphttptools, _cpthreadinglocal 38 from lib import autoreload 37 import cpg, _cputil, _cphttptools 38 39 try: 40 from threading import local 41 except ImportError: 42 from _cpthreadinglocal import local 43 44 45 from lib import autoreload, profiler 39 46 40 47 … … 66 73 # Create request and response object (the same objects will be used 67 74 # throughout the entire life of the webserver) 68 cpg.request = _cpthreadinglocal.local()69 cpg.response = _cpthreadinglocal.local()75 cpg.request = local() 76 cpg.response = local() 70 77 71 78 # Create threadData object as a thread-specific all-purpose storage 72 cpg.threadData = _cpthreadinglocal.local()79 cpg.threadData = local() 73 80 74 81 # Output config options (if cpg.config.get('server.logToScreen')) … … 93 100 for func in cpg.server.onStartServerList: 94 101 func() 102 103 # Set up the profiler if requested. 104 if cpg.config.get("profiling.on", False): 105 ppath = cpg.config.get("profiling.path", "") 106 cpg.profiler = profiler.Profiler(ppath) 107 else: 108 cpg.profiler = None 95 109 96 110 if not initOnly: … … 169 183 for func in cpg.server.onStartThreadList: 170 184 func(i) 171 return _cphttptools.Request(clientAddress, remoteHost, 172 requestLine, headers, rfile) 185 186 if cpg.profiler: 187 cpg.profiler.run(_cphttptools.Request, clientAddress, remoteHost, 188 requestLine, headers, rfile) 189 else: 190 _cphttptools.Request(clientAddress, remoteHost, 191 requestLine, headers, rfile) 173 192 174 193 def stop(): branches/ticket-177/cherrypy/lib/filter/sessionfilter.py
r251 r261 89 89 90 90 def generateSessionId(): 91 s = ''.join([random.choice(alphanum) for i in xrange(50)]) 92 s += '%s' % time.time() 91 s = "%s_%s" % (str(random.random()) , str(time.time())) 93 92 return sha.sha(s).hexdigest() 94 93 branches/ticket-177/cherrypy/test/test.py
r256 r261 157 157 'server.socketQueueSize': 5, 158 158 'server.logToScreen': False, 159 ## 'profiling.on': True, 159 160 } 160 161

