(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:
		@@ -1,6 +1,10 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
All changes to this project will be documented in this file.
 | 
					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
 | 
					## [8.3.3] - 2020-03-22
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(cobra to statsd) port to windows and add a unittest
 | 
					(cobra to statsd) port to windows and add a unittest
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,8 +7,8 @@
 | 
				
			|||||||
#include "IXUdpSocket.h"
 | 
					#include "IXUdpSocket.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "IXNetSystem.h"
 | 
					#include "IXNetSystem.h"
 | 
				
			||||||
#include <sstream>
 | 
					 | 
				
			||||||
#include <cstring>
 | 
					#include <cstring>
 | 
				
			||||||
 | 
					#include <sstream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace ix
 | 
					namespace ix
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,8 +89,12 @@ namespace ix
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (in.empty())
 | 
					        if (in.empty())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            uint8_t buf[6] = {0x02, 0x00, 0x00, 0x00, 0xff, 0xff};
 | 
					            // See issue #167
 | 
				
			||||||
            out.append((char*) (buf), 6);
 | 
					            // 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;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,4 +6,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IX_WEBSOCKET_VERSION "8.3.3"
 | 
					#define IX_WEBSOCKET_VERSION "8.3.4"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user