GNOME Bugzilla – Bug 788723
Websocket client connection failing with h2o library
Last modified: 2018-01-04 12:35:17 UTC
Created attachment 361196 [details] [review] session: don't change the Connection type for websocket connections We seem to inject "Connection: Keep-Alive" even for websocket connections.
If I understand correctly, the problem is that keep-alive is not necessary when establishing a WebSocket connections, as then we're no longer using HTTP but the WebSocket protocol instead. If that's the case, this change looks correct to me, but I rather get confirmation from Dan first.
Comment on attachment 361196 [details] [review] session: don't change the Connection type for websocket connections >+ !soup_message_headers_header_contains (item->msg->request_headers, >+ "Upgrade", "websocket")) { actually, make that !soup_message_headers_header_contains (item->msg->request_headers, "Connection", "Upgrade")) { if we're doing an upgrade, it doesn't matter what protocol we're upgrading to; we don't need to specify "Connection: Keep-Alive" in that case, since that only applies to old HTTP/1.0 servers, and upgrading is an HTTP/1.1 feature.
Created attachment 362486 [details] [review] session: don't change the Connection type for websocket connections
ping?
Review of attachment 362486 [details] [review]: Sorry for the delay. I think you need to fix the commit message, as your current approach is not to add the keep-alive header in any upgrade, not only for web sockets.
Created attachment 366257 [details] [review] session: don't request Keep-Alive for upgraded connections Thanks!
Review of attachment 366257 [details] [review]: Thanks!
Should I push this into the last stable branch too? Sounds like it could be useful.
Sure.
Review of attachment 366257 [details] [review]: Done.
Thanks!