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

Changeset 1550

Show
Ignore:
Timestamp:
12/21/06 15:01:28
Author:
fumanchu
Message:

Better solution to #625: have the SSL file objects inheirt the timeout of their socket, which is copied from httpserver.timeout.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_conn.py

    r1548 r1550  
    185185            self.assertBody("Hello, world!") 
    186186             
    187             if self.scheme == "https": 
    188                 # Adjust the timeout up to cover the higher timeouts of SSL 
    189                 # (the wsgiserver ssl_timeout default is 3 seconds) 
    190                 tout = 4 
    191             else: 
    192                 tout = timeout * 2 
    193              
    194187            # Wait for our socket timeout 
    195             time.sleep(tout
     188            time.sleep(timeout * 2
    196189             
    197190            # Make another request on the same socket, which should error 
  • trunk/cherrypy/wsgiserver.py

    r1549 r1550  
    546546         
    547547        if SSL and isinstance(sock, SSL.ConnectionType): 
     548            timeout = sock.gettimeout() 
    548549            self.rfile = SSL_fileobject(sock, "r", self.rbufsize) 
     550            self.rfile.ssl_timeout = timeout 
    549551            self.wfile = SSL_fileobject(sock, "w", self.wbufsize) 
     552            self.wfile.ssl_timeout = timeout 
    550553            self.environ["wsgi.url_scheme"] = "https" 
    551554            self.environ["HTTPS"] = "on" 

Hosted by WebFaction

Log in as guest/cpguest to create tickets