diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-10 22:39:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-10 22:39:33 +0300 |
commit | dcb62e4830223c1f5233d90b855e74006fd0942b (patch) | |
tree | 3b9c5be79f43958d8b9b2f691f0f6801d2aa25d0 /protocols/WhatsAppWeb/src | |
parent | cb462baced051c43598acf767058514a9aefd73c (diff) |
WebSocket_Connect to return the reply to a HTTP request instead of a connection
Diffstat (limited to 'protocols/WhatsAppWeb/src')
-rw-r--r-- | protocols/WhatsAppWeb/src/server.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/WhatsAppWeb/src/server.cpp b/protocols/WhatsAppWeb/src/server.cpp index df03c6badf..5fed264e36 100644 --- a/protocols/WhatsAppWeb/src/server.cpp +++ b/protocols/WhatsAppWeb/src/server.cpp @@ -372,13 +372,15 @@ bool WhatsAppProto::ServerThreadWorker() { 0, 0 } }; - m_hServerConn = WebSocket_Connect(m_hNetlibUser, "web.whatsapp.com/ws", hdrs); - if (m_hServerConn == nullptr) { + auto *pReply = WebSocket_Connect(m_hNetlibUser, "web.whatsapp.com/ws", hdrs); + if (pReply == nullptr) { debugLogA("Server connection failed, exiting"); return false; } debugLogA("Server connection succeeded"); + m_hServerConn = pReply->nlc; + Netlib_FreeHttpRequest(pReply); m_iLoginTime = time(0); m_szClientToken = getMStringA(DBKEY_CLIENT_TOKEN); |