INNER CODE UNIT · Python
_mark_request_input_complete
mars-tw/anti-gambling-trader-tw · core/ui/server.py:225
def _mark_request_input_complete(self, request: Any) -> None:
"""Switch one validated request from input protection to compute protection."""
key = id(request)
with self._owned_lock:
deadline = self._owned_request_deadlines.pop(key, None)
input_deadline = deadline[1] if deadline is not None else None
if key in self._owned_connections and not self._owned_closing:
self._schedule_owned_deadline_locked(
key,
_COMPUTE_DEADLINE_SECONDS,
)
if input_deadline is not None:
input_deadline.cancel()
def _process_owned_request_thread(self, request: Any, client_address: Any, key: int) -> None:
# The input timer only tears down this request socket. It never writes
# user data and complements the per-read timeout configured by the