MCPcopy Create free account
hub / github.com/apache/trafficserver / drain_response

Function drain_response

tests/gold_tests/post/expect_client.py:80–94  ·  view source on GitHub ↗

Drain the response from the server. :param sock: The socket to read the response from.

(sock: socket.socket)

Source from the content-addressed store, hash-verified

78
79
80def drain_response(sock: socket.socket) -> None:
81 """Drain the response from the server.
82
83 :param sock: The socket to read the response from.
84 """
85 print('Waiting for the response to complete.')
86 read_bytes: bytes = wait_for_headers_complete(sock)
87 try:
88 num_bytes_to_drain: int = determine_outstanding_bytes_to_read(read_bytes)
89 except ValueError:
90 print('No CL found')
91 return
92 if num_bytes_to_drain > 0:
93 drain_socket(sock, read_bytes, num_bytes_to_drain)
94 print('Response complete.')
95
96
97def main() -> int:

Callers 2

send_expect_requestFunction · 0.70
mainFunction · 0.70

Calls 3

drain_socketFunction · 0.90

Tested by

no test coverage detected