MCPcopy
hub / github.com/encode/uvicorn / receive

Method receive

uvicorn/protocols/http/h11_impl.py:526–544  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

524 self.on_response()
525
526 async def receive(self) -> ASGIReceiveEvent:
527 if self.waiting_for_100_continue and not self.transport.is_closing():
528 headers: list[tuple[str, str]] = []
529 event = h11.InformationalResponse(status_code=100, headers=headers, reason="Continue")
530 output = self.conn.send(event=event)
531 self.transport.write(output)
532 self.waiting_for_100_continue = False
533
534 if not self.disconnected and not self.response_complete:
535 self.flow.resume_reading()
536 await self.message_event.wait()
537 self.message_event.clear()
538
539 if self.disconnected or self.response_complete:
540 return {"type": "http.disconnect"}
541
542 message: HTTPRequestEvent = {"type": "http.request", "body": bytes(self.body), "more_body": self.more_body}
543 self.body = bytearray()
544 return message

Callers

nothing calls this directly

Calls 5

clearMethod · 0.80
is_closingMethod · 0.45
sendMethod · 0.45
writeMethod · 0.45
resume_readingMethod · 0.45

Tested by

no test coverage detected