Ticket #6768: twisted_proxy_disconnect.patch

File twisted_proxy_disconnect.patch, 677 bytes (added by Andy Lutomirski, 7 years ago)
  • twisted/web/proxy.py

    diff -r cb14745ec3f5 -r de94b78f190a pytools/webserver/improved_proxy.py
    a b  
    4949        headers.pop('keep-alive', None)
    5050        self.headers = headers
    5151        self.data = data
     52        father.notifyFinish().addErrback(self.fatherFailed)
    5253
    5354
    5455    def connectionMade(self):
     
    8990            self.transport.loseConnection()
    9091
    9192
     93    def fatherFailed(self, failure):
     94        if not self._finished:
     95            self.transport.loseConnection()
     96            self._finished = True
     97
     98
    9299
    93100class ProxyClientFactory(ClientFactory):
    94101    """