-
-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(WebSocket): handle
OSError
upon send()
+ fix `max_receive_que…
…ue == 0` (#2324) * feat(WebSocket): handle `OSError` upon `send()` * fix(WebSocket): fix the `max_receive_queue == 0` case (WiP) * chore: do not build rapidjson on PyPy * test(WebSocket): add tests for the max_receive_queue==0 case * docs(ws): revise "Lost Connections" in the light of ASGI WS spec 2.4 * docs: market this as bugfix instead * test(WS): add a zero receive queue test with real servers * docs(WS): polish newsfragment * docs(WS): tone down inline comment
- Loading branch information
Showing
10 changed files
with
227 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ pip-log.txt | |
.ecosystem | ||
.tox | ||
.pytest_cache | ||
downloaded_files/ | ||
geckodriver.log | ||
htmlcov | ||
nosetests.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Falcon will now raise an instance of | ||
:class:`~falcon.errors.WebSocketDisconnected` from the :class:`OSError` that | ||
the ASGI server signals in the case of a disconnected client (as per | ||
the `ASGI HTTP & WebSocket protocol | ||
<https://asgi.readthedocs.io/en/latest/specs/www.html#id2>`__ version ``2.4``). | ||
It is worth noting though that Falcon's | ||
:ref:`built-in receive buffer <ws_lost_connection>` normally detects the | ||
``websocket.disconnect`` event itself prior the potentially failing attempt to | ||
``send()``. | ||
|
||
Disabling this built-in receive buffer (by setting | ||
:attr:`~falcon.asgi.WebSocketOptions.max_receive_queue` to ``0``) was also | ||
found to interfere with receiving ASGI WebSocket messages in an unexpected | ||
way. The issue has been fixed so that setting this option to ``0`` now properly | ||
bypasses the buffer altogether, and extensive test coverage has been added for | ||
validating this scenario. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.