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

Changeset 243

Show
Ignore:
Timestamp:
06/05/05 04:24:59
Author:
fumanchu
Message:

1. Fixed bug in helper: native threaded server was not being instantiated due to missing "threadPool" config item.
2. Fixed bug in cachefilter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/filter/cachefilter.py

    r232 r243  
    131131        global cpg 
    132132        from cherrypy import cpg 
     133        cpg.threadData.cacheable = True 
    133134     
    134135    def beforeMain(self): 
     
    141142         
    142143        cacheData = cpg._cache.get() 
     144        cpg.threadData.cacheable = not cacheData 
    143145        if cacheData: 
    144146            expirationTime, lastModified, obj = cacheData 
     
    156158                cpg.response.body = body 
    157159            raise basefilter.RequestHandled 
    158         else: 
    159             cpg.threadData.cacheable = True 
    160160     
    161161    def onEndResource(self): 
  • trunk/cherrypy/test/helper.py

    r242 r243  
    4545    # The trying 10 times is simply in case of socket errors. 
    4646    # Normal case--it should run once. 
    47     for trial in xrange(10): 
     47    trial = 0 
     48    while trial < 10: 
    4849        try: 
    4950            conn = httplib.HTTPConnection('127.0.0.1:%s' % PORT) 
     51##            conn.set_debuglevel(1) 
    5052            conn.putrequest("GET", url) 
    5153##            conn.putheader("Host", "127.0.0.1") 
     
    7678             
    7779            conn.close() 
    78             break 
     80            return cpg, cookies 
    7981        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) 
    8287 
    8388def shutdownServer(mode): 
     
    130135def f(*a, **kw): return "" 
    131136cpg.root._cpLogMessage = f 
     137cpg.config.update(file = 'testsite.cfg') 
    132138''' 
    133139    newcode = code.replace('cpg.config.update', beforeStart + 'cpg.config.update') 
     
    188194                if not checkResult(testName, infoMap, mode, cpg, rule, failedList): 
    189195                    passed = 0 
    190                     print "*** FAILED ***" 
     196                    print "*** FAILED ***", 
    191197                    break 
    192198            shutdownServer(mode) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets