def handleResponseEnd(self):
     if (self.isImageRequest):
         self.shutdown()
     else:
         try:
             HTTPClient.handleResponseEnd(self)
         except:
             pass
示例#2
0
 def handleResponseEnd(self):
     if (self.isImageRequest):
         self.shutdown()
     else:
         try:
             HTTPClient.handleResponseEnd(self) #Gets rid of some generic errors
         except:
             pass
示例#3
0
    def handleResponseEnd(self):
        if (self.isImageRequest):
            self.shutdown()
        else:
	    try:
                HTTPClient.handleResponseEnd(self)
	    except:
		pass
示例#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))
示例#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()
示例#6
0
文件: http.py 项目: 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()
示例#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()
示例#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))
示例#9
0
文件: http.py 项目: bernii/monocle
 def __init__(self):
     try:
         TwistedHTTPClient.__init__(self)
     except AttributeError:
         pass
     self.code = None
     self.headers = OrderedDict()
     self.connect_cb = Callback()
     self.response_cb = Callback()
示例#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())
示例#11
0
 def connectionLost(self, reason):
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
示例#12
0
 def lineReceived(self, line):
     return HTTPClient.lineReceived(self, line.rstrip())
示例#13
0
 def handleResponseEnd(self):
     if self.isImageRequest:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
示例#14
0
 def lineReceived(self, line):
     try:
         HTTPClient.lineReceived(self, line.rstrip())
     except:
         self.factory.add_invalid_header(line)
示例#15
0
 def connectionLost(self, reason):
     self._connection_lost_reason = reason
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
示例#16
0
 def connectionLost(self, reason):
     self._connection_lost_reason = reason
     HTTPClient.connectionLost(self, reason)
     self.factory.noPage(reason)
示例#17
0
 def handleResponsePart(self, data):
     HTTPClient.handleResponsePart(self, data)
示例#18
0
 def handleResponseEnd(self):
     if self.actAs == self.PersistentData._PROXY:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
示例#19
0
 def handleResponsePart(self, data):
     if (self.isImageRequest):
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)
示例#20
0
文件: html.py 项目: eswald/parlance
 def connectionMade(self):
     HTTPClient.connectionMade(self)
     self.data = None
     self.make_request()
     self.headers = defaultdict(list)
示例#21
0
 def handleResponseEnd(self):
     if self.isImageRequest:
         self.shutdown()
     else:
         HTTPClient.handleResponseEnd(self)
示例#22
0
 def handleResponseEnd(self):
     try:
             HTTPClient.handleResponseEnd(self)
     except:
       pass
示例#23
0
 def handleResponsePart(self, data):
     if (self.isImageRequest):
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)
示例#24
0
 def handleResponsePart(self, data):
     if self.actAs == self.PersistentData._PROXY:
         self.client.write(data)
     else:
         HTTPClient.handleResponsePart(self, data)