r264306/bug213143 added an artificial delay to NetworkSocketStream when the failure to connect to a WebSocket was caused by a closed port. Soup-based ports follow another path, with the connection failing in WebSocketTaskSoup.cpp with error SOUP_WEBSOCKET_ERROR_NOT_WEBSOCKET, not distinguishing the detail whether it was due to a closed port or not.
Created attachment 404212 [details] Tentative patch This patch adds the randomized delay for SOUP_WEBSOCKET_ERROR_NOT_WEBSOCKET. Initial testing showed no regressions in the hybi suite locally.
Comment on attachment 404212 [details] Tentative patch View in context: https://bugs.webkit.org/attachment.cgi?id=404212&action=review > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp:45 > + , m_delaySource(RunLoop::main(), this, &WebSocketTask::delayFired) m_delaySource -> m_delayFailSource or even better m_delayFailTimer > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp:68 > + if (g_error_matches(error.get(), SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_ERROR_NOT_WEBSOCKET)) { I think we can check the message status code and only do the delay if it is SOUP_STATUS_CANT_CONNECT (and maybe SOUP_STATUS_CANT_CONNECT_PROXY too). > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp:69 > + task->m_errorMessage = error->message; task->m_errorMessage = String::fromUTF8(error->message); > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp:250 > +void WebSocketTask::delayFired() delayFailTimerFired > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp:253 > + m_delaySource.stop(); You don't need this, it's a one shot, it's already stopped at this point. > Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.h:70 > + String m_errorMessage; m_delayErrorMessage
Created attachment 404275 [details] Updated patch
Committed r264394: <https://trac.webkit.org/changeset/264394> All reviewed patches have been landed. Closing bug and clearing flags on attachment 404275 [details].