Add is_active_stream property.
This commit is contained in:
parent
fd279f8b6d
commit
cc8368acf6
|
@ -125,6 +125,14 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
not self.signal.stopped and
|
not self.signal.stopped and
|
||||||
self.parser.should_keep_alive())
|
self.parser.should_keep_alive())
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_active_stream(self):
|
||||||
|
return (
|
||||||
|
self.is_request_stream and
|
||||||
|
not self._paused and
|
||||||
|
self.request is not None and
|
||||||
|
self.request.stream)
|
||||||
|
|
||||||
# -------------------------------------------- #
|
# -------------------------------------------- #
|
||||||
# Connection
|
# Connection
|
||||||
# -------------------------------------------- #
|
# -------------------------------------------- #
|
||||||
|
@ -233,8 +241,7 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
exception = InvalidUsage(message)
|
exception = InvalidUsage(message)
|
||||||
self.write_error(exception)
|
self.write_error(exception)
|
||||||
|
|
||||||
if self.is_request_stream and not self._paused and \
|
if self.is_active_stream:
|
||||||
self.request is not None and self.request.stream:
|
|
||||||
if self.request.stream.qsize() > self.request_max_queue_size:
|
if self.request.stream.qsize() > self.request_max_queue_size:
|
||||||
self.transport.pause_reading()
|
self.transport.pause_reading()
|
||||||
self._paused = True
|
self._paused = True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user