MCPcopy Index your code
hub / github.com/python-websockets/websockets / parse_handshake

Function parse_handshake

experiments/optimization/parse_handshake.py:65–76  ·  view source on GitHub ↗
(handshake)

Source from the content-addressed store, hash-verified

63
64
65def parse_handshake(handshake):
66 reader = StreamReader()
67 reader.feed_data(handshake)
68 parser = Request.parse(reader.read_line)
69 try:
70 next(parser)
71 except StopIteration:
72 pass
73 else:
74 raise AssertionError("parser should return request")
75 reader.feed_eof()
76 assert reader.at_eof(), "parser should consume all data"
77
78
79def run_benchmark(name, handshake, number=10000):

Callers

nothing calls this directly

Calls 5

feed_dataMethod · 0.95
feed_eofMethod · 0.95
at_eofMethod · 0.95
StreamReaderClass · 0.90
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…