Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket sansio implementataion #2060
base: master
Are you sure you want to change the base?
Websocket sansio implementataion #2060
Changes from 13 commits
ca826db
559617b
56d2152
d12e72a
f24527b
ba972e0
b81f762
0f59f77
38e1629
29d2d09
28f2714
10933b6
3a72504
1239297
39e3c33
931e78e
3d57661
d76cdc6
ca6f63b
d246cc4
aed00c8
808f951
803100c
7519e6b
87ad36a
1048c18
37a686f
4f76f62
cbe36ba
348b6ac
48b1d5f
12bb2d2
498eaf5
e378770
3ce1611
4f601dc
d48f8c1
ab12969
65057b8
b81bd5a
63e6f68
b89d732
526fe56
0699a7e
82f3f6e
7a90b8b
e72cd54
d9a4ea0
252bdc1
9ff1a2e
bc35b4f
b82a8ce
09d3072
5a22d00
5f5f5f4
8dcd505
3f4eecb
60460f9
78c6941
0ade3d4
db31c56
bf00ada
64d6eb7
064a7fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://websockets.readthedocs.io/en/stable/howto/sansio.html
if I'm following this right after receiving data you should call receive_eof()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valentin994 @Kludex we don't have to call receive_eof() after receiving data. Because, protocol ensures that (https://docs.python.org/3/library/asyncio-protocol.html#asyncio.Protocol.data_received) data_received will only be called only when the data is there. In case when eof is received from client side, the transport will close and connection_lost will be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lines(117-119) are not being covered. Because, I guess in the test suite there not any test which after connection establishment sends data which causes receive_data to throw exception such as data which don't follow websocket spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to test it. It's unlikely that we want
Exception
there as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kludex @aaugustin Could you please help with this?
one scenario, where we can expect close frame is when the client sends it.
What other scenarios are there where we can expect it?
Can we expect it in scenarios where the we received unexpected data
and how can we have access to the close code, so that same code can be passed in disconnect event to asgi app