Edgewall Software

Ticket #9324: changeset_r198.diff

File changeset_r198.diff, 738 bytes (added by pipern, 2 years ago)

Catch and handle socket.timeout exception that setup_environ() can throw when HTTP client is inactive

  • trunk/trac/trac/web/wsgi.py

     
    178178        try: 
    179179            environ = self.setup_environ() 
    180         except (IOError, socket.error), e: 
     180        except (IOError, socket.error, socket.timeout), e: 
    181181            environ = None 
    182182            if e.args[0] in (errno.EPIPE, errno.ECONNRESET, 10053, 10054): 
    183183                # client disconnect 
     184                self.close_connection = 1 
     185            elif isinstance(e,socket.timeout): 
     186                # client connection timedout 
    184187                self.close_connection = 1 
    185188            else: