mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-10-21 02:58:45 +00:00
handle timeouted h2 connections, refill reply budget
This commit is contained in:
1 parent
59c3a6e3b3
commit
3cda0f5446
4 files changed
+95
-4
No files matched your search
@@ -49,7 +49,14 @@ class _ResponseStream(httpx.AsyncByteStream):
|
||||
try:
|
||||
await asyncio.wait_for(self.changed.wait(), self.read_timeout)
|
||||
except asyncio.TimeoutError as exc:
|
||||
raise httpx.ReadTimeout('Timed out waiting for H2 stream %d' % self.stream_id) from exc
|
||||
error = httpx.ReadTimeout('Timed out waiting for H2 stream %d' % self.stream_id)
|
||||
# An idle socket can remain established after the path stops
|
||||
# delivering data. Reconnect once its last active request times
|
||||
# out, while preserving unrelated requests and buffered replies.
|
||||
if not any(stream is not self and not stream.ended
|
||||
for stream in self.connection.streams.values()):
|
||||
self.connection.fail(error)
|
||||
raise error from exc
|
||||
|
||||
def check_error(self):
|
||||
if self.error is not None:
|
||||
|
||||
Reference in new issue
Block a user