MCPcopy
hub / github.com/benoitc/gunicorn / write_chunk

Function write_chunk

gunicorn/util.py:328–333  ·  view source on GitHub ↗
(sock, data)

Source from the content-addressed store, hash-verified

326
327
328def write_chunk(sock, data):
329 if isinstance(data, str):
330 data = data.encode('utf-8')
331 chunk_size = "%X\r\n" % len(data)
332 chunk = b"".join([chunk_size.encode('utf-8'), data, b"\r\n"])
333 sock.sendall(chunk)
334
335
336def write(sock, data, chunked=False):

Callers 1

writeFunction · 0.85

Calls 2

encodeMethod · 0.80
sendallMethod · 0.45

Tested by

no test coverage detected