def lineReceived(self, line): # Pass through end of header if not line: QueryProtocol.lineReceived(self, line) return # seperate with any single valid EOL combination. # '\n\n' becomes ['',''] lines = line.splitlines() # Pass one at a time until we pass the header while self.line_mode and len(lines): line = lines.pop(0) QueryProtocol.lineReceived(self, line) # Any remaining lines are really part of the body # join with arbitrary EOL since XML parser should # be able to handle it. if len(lines): self.rawDataReceived('\n\r'.join(lines))
def handleResponseEnd(self): QueryProtocol.handleResponseEnd(self) self.setTimeout(None) self.transport.loseConnection()
def connectionLost(self, reason): self.setTimeout(None) QueryProtocol.connectionLost(self, reason)
def connectionMade(self): QueryProtocol.connectionMade(self) if self.factory.rpc_timeout: self.setTimeout(self.factory.rpc_timeout.get())