Web socket over http2 issue #315
chesskingaka
started this conversation in
General
Replies: 1 comment 2 replies
-
|
For 1. can you provide the error logs as well as the Cowboy setup? What you did is exactly what the test suite does so I'm a bit surprised you get a race condition. Plus since we always send the ack before handling the ws_upgrade there shouldn't be any problem. For 2. I thought about it and there's a todo but I'm not sure. I'd like to see what it will look like for HTTP/3 (which I'm working on) and perhaps WebTransport. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have ve two issues for discussion to see if we can make the changes for that.
before I made the test as step below. (Cowboy:start_clear with enable_connect_protocol=true was called before, http2 as protocol)
{ok, ConnPid} = gun:open("localhost", config(port, Config), #{ protocols => [Protocol], http2_opts => #{notify_settings_changed => true} }), {ok, Protocol} = gun:await_up(ConnPid), {notify, settings_changed, #{enable_connect_protocol := true}} = gun:await(ConnPid, undefined), StreamRef = gun:ws_upgrade(ConnPid, "/", []). ....And I see that the gun_ws_upgrade function was failed with an error: "Stream was reset by server" after investigation, look like the issue is the value enable_connect_protocol in local_settings still not updated yet ( The value of enable_connect_protocol in local_settings is used for verifying, not remote_settings field in #http2_machine)
And I see that after sending the ACK_SETTING frame, the enable_connect_protocol value will be passed to local_settings from remote_settings
My concern is can we change the order of the "sending setting_ack frame" function and "sending gun_notify" function to avoid this issue, since if the gun:ws_upgrade was called before the value of enable_connect_protocol is updated succesfully in local_settings , the function will failed.
gun:wait/2 now need the stream_refs as second parameter, in case of "gun_notify" we don't have stream_refs (also stream_refs not used), so gun:wait with stream_refs = undefined can be used, but it can be lead to the dialyzer issue
Beta Was this translation helpful? Give feedback.
All reactions