diff --git a/Source/HTTP/WinHttp/winhttp_connection.cpp b/Source/HTTP/WinHttp/winhttp_connection.cpp index 07df2f20..c1681e1f 100644 --- a/Source/HTTP/WinHttp/winhttp_connection.cpp +++ b/Source/HTTP/WinHttp/winhttp_connection.cpp @@ -396,6 +396,11 @@ HRESULT WinHttpConnection::Close(ConnectionClosedCallback callback) m_state = ConnectionState::WebSocketClosing; break; } + case ConnectionState::WebSocketClosing: + { + // Nothing to do. WinHttpClose will happen after websocket close completes + return S_OK; + } case ConnectionState::WinHttpClosing: { // Nothing to do diff --git a/Source/HTTP/WinHttp/winhttp_provider.cpp b/Source/HTTP/WinHttp/winhttp_provider.cpp index d1847444..90a209f0 100644 --- a/Source/HTTP/WinHttp/winhttp_provider.cpp +++ b/Source/HTTP/WinHttp/winhttp_provider.cpp @@ -242,6 +242,8 @@ HRESULT WinHttpProvider::WebSocketConnectAsync(const char* uri, const char* /*su m_connections.push_back(connection); RETURN_IF_FAILED(connection->WebSocketConnectAsync(async)); + websocketHandle->impl = std::move(connection); + return S_OK; } #endif