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

Method connection_lost

uvicorn/protocols/http/httptools_impl.py:115–132  ·  uvicorn/protocols/http/httptools_impl.py::HttpToolsProtocol.connection_lost
(self, exc: Exception | None)

Source from the content-addressed store, hash-verified

113 self.logger.log(TRACE_LOG_LEVEL, class="st">"%sHTTP connection made", prefix)
114
115 def connection_lost(self, exc: Exception | None) -> None:
116 self.connections.discard(self)
117
118 if self.logger.level <= TRACE_LOG_LEVEL:
119 prefix = class="st">"%s:%d - " % self.client if self.client else class="st">""
120 self.logger.log(TRACE_LOG_LEVEL, class="st">"%sHTTP connection lost", prefix)
121
122 if self.cycle and not self.cycle.response_complete:
123 self.cycle.disconnected = True
124 if self.cycle is not None:
125 self.cycle.message_event.set()
126 if self.flow is not None:
127 self.flow.resume_writing()
128 if exc is None:
129 self.transport.close()
130 self._unset_keepalive_if_required()
131
132 self.parser = None class="cm"># type: ignore[assignment]
133
134 def eof_received(self) -> None:
135 pass

Callers

nothing calls this directly

Calls 3

resume_writingMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected