def send_response(self): status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) response = BaseResponse(status=status, headers=self.response_headers) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection response.task = self.task self.task.queue.put(response)
def send_response(self): status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) body = b''.join(self.response_body) response = BaseResponse(status=status, headers=self.response_headers, body=body) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection self.task.queue.put(response)
def send_response(self): status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) body = b''.join(self.response_body) response = BaseResponse(status=status, headers=self.response_headers, body=body) self.task.queue.put(response)
def send_response(self): if self.task.responsed: xlog.error("http2_stream send_response but responsed.%s", self.task.url) self.close("h2 stream send_response but sended.") return self.task.responsed = True status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) response = BaseResponse(status=status, headers=self.response_headers) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection response.task = self.task self.task.queue.put(response)
def send_response(self): if self.task.responsed: xlog.error("http2_stream send_response but responsed.%s", self.task.url) self.close("h2 stream send_response but sended.") return self.task.responsed = True status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) response = simple_http_client.BaseResponse(status=status, headers=self.response_headers) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection response.task = self.task self.task.queue.put(response) check_local_network.report_ok(self.connection.ssl_sock.ip)
def send_response(self): if self.task.responsed: self.logger.error("http2_stream send_response but responsed.%s", self.task.url) self.close("h2 stream send_response but sended.") return self.task.responsed = True status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) response = simple_http_client.BaseResponse(status=status, headers=self.response_headers) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection response.task = self.task self.task.queue.put(response) if status in self.config.http2_status_to_close: self.connection.close("status %d" % status)
def send_response(self): if self.task.responsed: xlog.error("http2_stream send_response but responsed.%s", self.task.url) self.close("h2 stream send_response but sended.") return self.task.responsed = True status = int(self.response_headers[b':status'][0]) strip_headers(self.response_headers) response = BaseResponse(status=status, headers=self.response_headers) response.ssl_sock = self.connection.ssl_sock response.worker = self.connection response.task = self.task self.task.queue.put(response) if status in [400, 403]: self.connection.close("status %d" % status)