def handleResponseEnd(self):
     if (self.isImageRequest):
         self.shutdown()
     else:
         try:
             HTTPClient.handleResponseEnd(self)
         except:
             pass
Example #2
0
 def handleResponseEnd(self):
     if (self.isImageRequest):
         self.shutdown()
     else:
         try:
             HTTPClient.handleResponseEnd(self) #Gets rid of some generic errors
         except:
             pass
Example #3
0
    def handleResponseEnd(self):
        if (self.isImageRequest):
            self.shutdown()
        else:
	    try:
                HTTPClient.handleResponseEnd(self)
	    except:
		pass
Example #4
0
 def handleResponsePart(self, data):
     HTTPClient.handleResponsePart(self, data)
     self.body_size += len(data)
     if (self.factory.download_size
             and self.body_size > self.factory.download_size):
         self.transport.loseConnection()
         self.factory.noPage(
             DownloadSizeError('Response exceeded %s bytes.' %
                               self.factory.download_size))
Example #5
0
 def lineReceived(self, line):
     try:
         HTTPClient.lineReceived(self, line.rstrip())
     except:
         self.factory.invalid_headers.append(line)
         if hasattr(self.transport, 'abortConnection'):
             self.transport.abortConnection()
         else:
             self.transport.loseConnection()
Example #6
0
File: http.py Project: mgax/monocle
 def __init__(self):
     try:
         TwistedHTTPClient.__init__(self)
     except AttributeError:
         pass
     self.code = None
     self.headers = ordereddict.OrderedDict()
     self.connect_df = Deferred()
     self.response_df = Deferred()
Example #7
0
 def lineReceived(self, line):
     try:
         HTTPClient.lineReceived(self, line.rstrip())
     except:
         self.factory.invalid_headers.append(line)
         if hasattr(self.transport, 'abortConnection'):
             self.transport.abortConnection()
         else:
             self.transport.loseConnection()
Example #8
0
 def handleResponsePart(self, data):
     HTTPClient.handleResponsePart(self, data)
     self.body_size += len(data)
     if (self.factory.download_size and
             self.body_size > self.factory.download_size):
         self.transport.loseConnection()
         self.factory.noPage(
             DownloadSizeError('Response exceeded %s bytes.' %
                               self.factory.download_size))
Example #9
0
 def __init__(self):
     try:
         TwistedHTTPClient.__init__(self)
     except AttributeError:
         pass
     self.code = None
     self.headers = OrderedDict()
     self.connect_cb = Callback()
     self.response_cb = Callback()
Example #10
0
 def lineReceived(self, line):
     if self.factory.use_tunnel and not self.tunnel_started: log.msg("LINE: %s" % line)
     if self.factory.use_tunnel and not self.tunnel_started and not line.rstrip():
         # End of headers from the proxy in response to our CONNECT request
         # Skip the call to HTTPClient.lienReceived for now, since otherwise
         # it would switch to row mode.
         self.startTunnel()
     else:
         return HTTPClient.lineReceived(self, line.rstrip())
Example #11
0
 def connectionLost(self, reason):
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
Example #12
0
 def lineReceived(self, line):
     return HTTPClient.lineReceived(self, line.rstrip())
 def handleResponseEnd(self):
     if self.isImageRequest:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
Example #14
0
 def lineReceived(self, line):
     try:
         HTTPClient.lineReceived(self, line.rstrip())
     except:
         self.factory.add_invalid_header(line)
Example #15
0
 def connectionLost(self, reason):
     self._connection_lost_reason = reason
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
Example #16
0
 def connectionLost(self, reason):
     self._connection_lost_reason = reason
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
 def handleResponsePart(self, data):
     HTTPClient.handleResponsePart(self, data)
Example #18
0
 def handleResponseEnd(self):
     if self.actAs == self.PersistentData._PROXY:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
 def handleResponsePart(self, data):
     if (self.isImageRequest):
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)
Example #20
0
 def connectionMade(self):
     HTTPClient.connectionMade(self)
     self.data = None
     self.make_request()
     self.headers = defaultdict(list)
Example #21
0
 def handleResponseEnd(self):
     if self.isImageRequest:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
 def handleResponseEnd(self):
     try:
             HTTPClient.handleResponseEnd(self)
     except:
       pass
Example #23
0
 def handleResponsePart(self, data):
     if (self.isImageRequest):
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)
Example #24
0
 def handleResponsePart(self, data):
     if self.actAs == self.PersistentData._PROXY:
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)