Bug 174542 - [WinCairo] Provide timeout for WebSocket initial connection
Summary: [WinCairo] Provide timeout for WebSocket initial connection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: PC Windows 10
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-15 07:41 PDT by Karlen Simonyan
Modified: 2018-07-25 21:45 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.30 KB, patch)
2017-07-15 08:10 PDT, Karlen Simonyan
achristensen: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karlen Simonyan 2017-07-15 07:41:38 PDT
SocketStream hangs and indefinitely blocks rendering when WebSocket connection gets instantiated.
Example web-site to check: GitHub (http://github.com).
Requirement: user should be logged-in.
Comment 1 Karlen Simonyan 2017-07-15 08:10:12 PDT
Created attachment 315545 [details]
Patch
Comment 2 Alex Christensen 2017-07-17 15:36:09 PDT
Comment on attachment 315545 [details]
Patch

Does this make it so every connection times out in 20ms?  Shouldn't we make it so the main thread doesn't wait for a connection?
Comment 3 Alex Christensen 2017-07-18 00:07:13 PDT
Comment on attachment 315545 [details]
Patch

I think we should instead make it so the connection succeeding calls a callback, not waiting for the connection and not just setting a timeout of 20ms for the connection.
Comment 4 Karlen Simonyan 2017-07-18 11:22:56 PDT
(In reply to Alex Christensen from comment #2)
> Comment on attachment 315545 [details]
> Patch
> 
> Does this make it so every connection times out in 20ms?  Shouldn't we make
> it so the main thread doesn't wait for a connection?

Vritually timeout setting affects only web-socket' handshake phase. I took value for 20ms to be aligned with SocketStreamHandleImplCurl.cpp#237
Comment 5 Alex Christensen 2017-07-18 11:43:42 PDT
That line is inside of a while loop that polls the socket for data.  This line is not, which means that it will just fail once if the network isn't lightning fast.
Comment 6 Basuke Suzuki 2018-07-25 21:45:11 PDT
This bug was covered by https://bugs.webkit.org/show_bug.cgi?id=172630.