summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-10-01 21:32:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-10-01 21:32:18 +0300
commit0f65b85e68f7ad9068b0e20f0cade4c4c41c454e (patch)
tree1e9cf5a827ee59d12860bef37e3200d870969e7f
parent4be5a11d0b125c1444400cf348613eb54ac4df28 (diff)
minor code cleaning
-rw-r--r--protocols/WhatsAppWeb/src/noise.cpp2
-rw-r--r--protocols/WhatsAppWeb/src/server.cpp8
-rw-r--r--protocols/WhatsAppWeb/src/utils.cpp2
-rw-r--r--protocols/WhatsAppWeb/src/wanode.cpp4
4 files changed, 8 insertions, 8 deletions
diff --git a/protocols/WhatsAppWeb/src/noise.cpp b/protocols/WhatsAppWeb/src/noise.cpp
index 68f2549bf9..30449aa09d 100644
--- a/protocols/WhatsAppWeb/src/noise.cpp
+++ b/protocols/WhatsAppWeb/src/noise.cpp
@@ -208,7 +208,7 @@ size_t WANoise::decodeFrame(const void *&pData, size_t &cbLen)
payloadLen += p[i];
}
- ppro->debugLogA("got payload of size %d", payloadLen);
+ // ppro->debugLogA("got payload of size %d", payloadLen);
cbLen -= 3;
if (payloadLen > cbLen) {
diff --git a/protocols/WhatsAppWeb/src/server.cpp b/protocols/WhatsAppWeb/src/server.cpp
index 3dedd162fb..7cbdba3a20 100644
--- a/protocols/WhatsAppWeb/src/server.cpp
+++ b/protocols/WhatsAppWeb/src/server.cpp
@@ -18,7 +18,7 @@ void WhatsAppProto::ServerThread(void *)
}
while (m_bRespawn);
- ShutdownSession();
+ OnLoggedOut();
}
void WhatsAppProto::ServerThreadWorker()
@@ -80,8 +80,8 @@ void WhatsAppProto::ServerThreadWorker()
if (!WSReadPacket(hdr, netbuf))
break;
- debugLogA("Got packet: buffer = %d, opcode = %d, headerSize = %d, payloadSize = %d, final = %d, masked = %d",
- netbuf.length(), hdr.opCode, hdr.headerSize, hdr.payloadSize, hdr.bIsFinal, hdr.bIsMasked);
+ // debugLogA("Got packet: buffer = %d, opcode = %d, headerSize = %d, payloadSize = %d, final = %d, masked = %d",
+ // netbuf.length(), hdr.opCode, hdr.headerSize, hdr.payloadSize, hdr.bIsFinal, hdr.bIsMasked);
// Netlib_Dump(m_hServerConn, netbuf.data(), netbuf.length(), false, 0);
m_lastRecvTime = time(0);
@@ -136,7 +136,7 @@ void WhatsAppProto::ServerThreadWorker()
}
netbuf.remove(hdr.headerSize + hdr.payloadSize);
- debugLogA("%d bytes removed from network buffer, %d bytes remain", hdr.headerSize + hdr.payloadSize, netbuf.length());
+ // debugLogA("%d bytes removed from network buffer, %d bytes remain", hdr.headerSize + hdr.payloadSize, netbuf.length());
if (netbuf.length() == 0)
break;
diff --git a/protocols/WhatsAppWeb/src/utils.cpp b/protocols/WhatsAppWeb/src/utils.cpp
index 885393a354..01e299aca3 100644
--- a/protocols/WhatsAppWeb/src/utils.cpp
+++ b/protocols/WhatsAppWeb/src/utils.cpp
@@ -157,7 +157,7 @@ int WhatsAppProto::WSSendNode(WANode &node, WA_PKT_HANDLER pHandler)
CMStringA szText;
node.print(szText);
- debugLogA("Sending binary node: %s", szText.c_str());
+ debugLogA("Sending binary node:\n%s", szText.c_str());
WAWriter writer;
writer.writeNode(&node);
diff --git a/protocols/WhatsAppWeb/src/wanode.cpp b/protocols/WhatsAppWeb/src/wanode.cpp
index 72d8bec38c..f3d4053e7d 100644
--- a/protocols/WhatsAppWeb/src/wanode.cpp
+++ b/protocols/WhatsAppWeb/src/wanode.cpp
@@ -526,8 +526,8 @@ void WAWriter::writePacked(const CMStringA &str, int tag)
writeByte(tag);
int len = str.GetLength() / 2;
- BYTE firstByte = (str.GetLength() % 2) == 0 ? 0 : 0x80;
- writeByte(firstByte | len);
+ BYTE firstByte = (str.GetLength() % 2) == 0 ? 0 : 0x81;
+ writeByte(firstByte + len);
const char *p = str;
for (int i = 0; i < len; i++, p += 2)