From c6646a4fbf19011b2c1aaea49e1fa2becfe8cc7b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Jan 2017 20:37:38 +0300 Subject: adding zlib --- protocols/Discord/src/gateway.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/Discord/src/gateway.cpp') diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp index a7352d4120..adf07eff4a 100644 --- a/protocols/Discord/src/gateway.cpp +++ b/protocols/Discord/src/gateway.cpp @@ -146,7 +146,7 @@ void CDiscordProto::GatewayThread(void*) sel.dwTimeout = 1000; sel.hReadConns[0] = m_hGatewayConnection; if (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&sel) == 0) // timeout, send a hartbeat packet - GatewaySend(3, "{ \"op\":1, \"d\":(null) }"); + GatewaySend(0, "{ \"op\":1, \"d\":(null) }"); unsigned char buf[2048]; int bufSize = Netlib_Recv(m_hGatewayConnection, (char*)buf+offset, _countof(buf) - offset, 0); @@ -218,6 +218,11 @@ void CDiscordProto::GatewayThread(void*) case 2: // continuation if (bIsFinal) { // process a packet here + z_stream stream = {}; + stream.next_in = dataBuf + headerSize; + stream.avail_in = bufSize - headerSize; + deflate(&stream, true); + mir_free(dataBuf); dataBuf = NULL; dataBufSize = 0; } -- cgit v1.2.3