Changeset 243
- Timestamp:
- 06/05/05 04:24:59
- Files:
-
- trunk/cherrypy/_cphttpserver.py (modified) (previous)
- trunk/cherrypy/_cphttptools.py (modified) (previous)
- trunk/cherrypy/_cpserver.py (modified) (previous)
- trunk/cherrypy/_cpwsgi.py (modified) (previous)
- trunk/cherrypy/_cpwsgiserver.py (modified) (previous)
- trunk/cherrypy/lib/filter/cachefilter.py (modified) (3 diffs)
- trunk/cherrypy/lib/filter/gzipfilter.py (modified) (previous)
- trunk/cherrypy/lib/filter/logdebuginfofilter.py (modified) (previous)
- trunk/cherrypy/lib/filter/sessionfilter.py (modified) (previous)
- trunk/cherrypy/lib/filter/tidyfilter.py (modified) (previous)
- trunk/cherrypy/lib/filter/virtualhostfilter.py (modified) (previous)
- trunk/cherrypy/lib/filter/xmlrpcfilter.py (modified) (previous)
- trunk/cherrypy/test/helper.py (modified) (4 diffs)
- trunk/cherrypy/test/test.py (modified) (previous)
- trunk/cherrypy/test/testCore.py (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/filter/cachefilter.py
r232 r243 131 131 global cpg 132 132 from cherrypy import cpg 133 cpg.threadData.cacheable = True 133 134 134 135 def beforeMain(self): … … 141 142 142 143 cacheData = cpg._cache.get() 144 cpg.threadData.cacheable = not cacheData 143 145 if cacheData: 144 146 expirationTime, lastModified, obj = cacheData … … 156 158 cpg.response.body = body 157 159 raise basefilter.RequestHandled 158 else:159 cpg.threadData.cacheable = True160 160 161 161 def onEndResource(self): trunk/cherrypy/test/helper.py
r242 r243 45 45 # The trying 10 times is simply in case of socket errors. 46 46 # Normal case--it should run once. 47 for trial in xrange(10): 47 trial = 0 48 while trial < 10: 48 49 try: 49 50 conn = httplib.HTTPConnection('127.0.0.1:%s' % PORT) 51 ## conn.set_debuglevel(1) 50 52 conn.putrequest("GET", url) 51 53 ## conn.putheader("Host", "127.0.0.1") … … 76 78 77 79 conn.close() 78 break80 return cpg, cookies 79 81 except socket.error: 80 time.sleep(0.5) 81 return cpg, cookies 82 trial += 1 83 if trial == 10: 84 raise 85 else: 86 time.sleep(0.5) 82 87 83 88 def shutdownServer(mode): … … 130 135 def f(*a, **kw): return "" 131 136 cpg.root._cpLogMessage = f 137 cpg.config.update(file = 'testsite.cfg') 132 138 ''' 133 139 newcode = code.replace('cpg.config.update', beforeStart + 'cpg.config.update') … … 188 194 if not checkResult(testName, infoMap, mode, cpg, rule, failedList): 189 195 passed = 0 190 print "*** FAILED ***" 196 print "*** FAILED ***", 191 197 break 192 198 shutdownServer(mode)

