mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
#550 WebSocket fragmented message problem
This commit is contained in:
parent
84adc737d4
commit
cd67863852
@ -76,7 +76,8 @@ public:
|
||||
FRAME_OP_CLOSE = 0x08, /// Close connection.
|
||||
FRAME_OP_PING = 0x09, /// Ping frame.
|
||||
FRAME_OP_PONG = 0x0a, /// Pong frame.
|
||||
FRAME_OP_BITMASK = 0x0f /// Bit mask for opcodes.
|
||||
FRAME_OP_BITMASK = 0x0f, /// Bit mask for opcodes.
|
||||
FRAME_OP_SETRAW = 0x100 /// Set raw flags (for use with sendBytes() and FRAME_OP_CONT).
|
||||
};
|
||||
|
||||
enum SendFlags
|
||||
|
@ -101,6 +101,7 @@ void WebSocket::shutdown(Poco::UInt16 statusCode, const std::string& statusMessa
|
||||
|
||||
int WebSocket::sendFrame(const void* buffer, int length, int flags)
|
||||
{
|
||||
flags |= FRAME_OP_SETRAW;
|
||||
return static_cast<WebSocketImpl*>(impl())->sendBytes(buffer, length, flags);
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,7 @@ int WebSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
||||
Poco::BinaryWriter writer(ostr, Poco::BinaryWriter::NETWORK_BYTE_ORDER);
|
||||
|
||||
if (flags == 0) flags = WebSocket::FRAME_BINARY;
|
||||
flags &= 0xff;
|
||||
writer << static_cast<Poco::UInt8>(flags);
|
||||
Poco::UInt8 lengthByte(0);
|
||||
if (_mustMaskPayload)
|
||||
|
Loading…
Reference in New Issue
Block a user