(websocket) fix #167, a long standing issue with sending empty messages with per-message deflate extension (and hopefully other zlib bug)

This commit is contained in:
Benjamin Sergeant 2020-03-23 15:21:53 -07:00
parent e0733d205c
commit f41a54186c
4 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.
## [8.3.4] - 2020-03-23
(websocket) fix #167, a long standing issue with sending empty messages with per-message deflate extension (and hopefully other zlib bug)
## [8.3.3] - 2020-03-22
(cobra to statsd) port to windows and add a unittest

View File

@ -7,8 +7,8 @@
#include "IXUdpSocket.h"
#include "IXNetSystem.h"
#include <sstream>
#include <cstring>
#include <sstream>
namespace ix
{

View File

@ -89,8 +89,12 @@ namespace ix
if (in.empty())
{
uint8_t buf[6] = {0x02, 0x00, 0x00, 0x00, 0xff, 0xff};
out.append((char*) (buf), 6);
// See issue #167
// The normal buffer size should be 6 but
// we remove the 4 octets from the tail (#4)
uint8_t buf[2] = {0x02, 0x00};
out.append((char*) (buf), 2);
return true;
}

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "8.3.3"
#define IX_WEBSOCKET_VERSION "8.3.4"