def receive_win_response(self, buf): ''' Receives a win response buffer and checks if it has a full HTTP response, if it does it invokes the plugin and returns an empty buffer, otherwise the buffer is returned as it was passed ''' logging.debug('receive_win_response') response = RTBResponse() ok, parser = response.receive_buffer(buf) if ok and self.plugin_instance: self.plugin_instance.receive_win_response(parser.get_status_code(), parser.get_headers(), parser.recv_body()) return '' return buf
def receive_win_response(self, buf): ''' Receives a win response buffer and checks if it has a full HTTP response, if it does it invokes the plugin and returns an empty buffer, otherwise the buffer is returned as it was passed ''' logging.debug('receive_win_response') response = RTBResponse() ok, parser = response.receive_buffer(buf) if ok and self.plugin_instance : self.plugin_instance.receive_win_response( parser.get_status_code(), parser.get_headers(), parser.recv_body()) return '' return buf
def receive_response(self, buf): ''' Receives a response buffer and checks if it has a full HTTP response, if it does it invokes the plugin and returns an empty buffer, otherwise the buffer is returned as it was passed ''' logging.debug('receive_response') response = RTBResponse() ok, parser = response.receive_buffer(buf) if ok: if self.plugin_instance: win, req_line, headers, body = \ self.plugin_instance.receive_response( parser.get_status_code(), parser.get_headers(), parser.recv_body()) return ('', win, req_line, headers, body) else: return (buf, None, None, None, None)
def receive_response(self, buf): ''' Receives a response buffer and checks if it has a full HTTP response, if it does it invokes the plugin and returns an empty buffer, otherwise the buffer is returned as it was passed ''' logging.debug('receive_response') response = RTBResponse() ok, parser = response.receive_buffer(buf) if ok : if self.plugin_instance : win, req_line, headers, body = \ self.plugin_instance.receive_response( parser.get_status_code(), parser.get_headers(), parser.recv_body()) return ('', win, req_line, headers, body) else: return (buf, None, None, None, None)