Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.__stat = 9
self.push ("rset")
return
self.__stat = 6
self.push ("data")
elif self.__stat == 6:
if code != 354:
self.__code, self.__resp = code, resp
self.__stat = 9
self.push ("rset")
return
self.__stat = 9
q = quotedata (self.composer.get_DATA ()) + ".\r\n"
self.push_with_producer (producers.simple_producer (q.encode ("utf8")))
#self.push (q.encode ("utf8"))
self.__sent = len (q)
elif self.__stat == 9:
if self.__sent and code == 250:
self.__code, self.__resp = -250, "OK"
elif self.__sent:
self.__code, self.__resp = code, resp
self.__stat = 10
self.push ("quit")
else:
self.handle_close ()
def handle_request (self, handler):
self.request = handler.request
stream_id = self.get_new_stream_id ()
self.add_request (stream_id, handler)
self.asyncon.set_active (False)
headers, content_encoded = handler.get_request_header ("2.0", False)
payload = handler.get_request_payload ()
producer = None
if payload:
if type (payload) is bytes:
producer = producers.globbing_producer (
producers.simple_producer (payload)
)
else:
# multipart, grpc_producer
producer = producers.globbing_producer (payload)
header = h2header_producer (stream_id, headers, producer, self.conn, self._clock)
self.asyncon.push (header)
if producer:
payload = h2frame_producer (stream_id, 0, 1, producer, self.conn, self._clock)
# is it proper?
#payload = producers.ready_globbing_producer (payload)
self.asyncon.push (payload)