MCPcopy Create free account
hub / github.com/pyload/pyload / write

Method write

module/lib/wsgiserver/__init__.py:621–638  ·  view source on GitHub ↗

WSGI callable to write unbuffered data to the client. This method is also used internally by start_response (to write data from the iterable returned by the WSGI application).

(self, chunk)

Source from the content-addressed store, hash-verified

619 return self.write
620
621 def write(self, chunk):
622 """WSGI callable to write unbuffered data to the client.
623
624 This method is also used internally by start_response (to write
625 data from the iterable returned by the WSGI application).
626 """
627 if not self.started_response:
628 raise AssertionError("WSGI write called before start_response.")
629
630 if not self.sent_headers:
631 self.sent_headers = True
632 self.send_headers()
633
634 if self.chunked_write and chunk:
635 buf = [hex(len(chunk))[2:], "\r\n", chunk, "\r\n"]
636 self.wfile.sendall("".join(buf))
637 else:
638 self.wfile.sendall(chunk)
639
640 def send_headers(self):
641 """Assert, process, and send the HTTP response message-headers."""

Callers 4

_respondMethod · 0.95
decode_chunkedMethod · 0.45
readMethod · 0.45
readlineMethod · 0.45

Calls 3

send_headersMethod · 0.95
joinMethod · 0.80
sendallMethod · 0.45

Tested by

no test coverage detected