From 1f8fcaacc0d72db25f3750629040306a1647c9c7 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Sun, 26 May 2013 00:15:54 +0200 Subject: [PATCH] WebSocketImpl::sendBytes() now uses FRAME_BINARY if given flags are all zero. --- Net/src/WebSocketImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Net/src/WebSocketImpl.cpp b/Net/src/WebSocketImpl.cpp index 5177ab2e7..e24128465 100644 --- a/Net/src/WebSocketImpl.cpp +++ b/Net/src/WebSocketImpl.cpp @@ -1,7 +1,7 @@ // // WebSocketImpl.cpp // -// $Id: //poco/1.4/Net/src/WebSocketImpl.cpp#6 $ +// $Id: //poco/1.4/Net/src/WebSocketImpl.cpp#8 $ // // Library: Net // Package: WebSocket @@ -73,6 +73,7 @@ int WebSocketImpl::sendBytes(const void* buffer, int length, int flags) Poco::MemoryOutputStream ostr(frame.begin(), frame.size()); Poco::BinaryWriter writer(ostr, Poco::BinaryWriter::NETWORK_BYTE_ORDER); + if (flags == 0) flags = WebSocket::FRAME_BINARY; writer << static_cast(flags); Poco::UInt8 lengthByte(0); if (_mustMaskPayload) @@ -321,5 +322,5 @@ Poco::Timespan WebSocketImpl::getReceiveTimeout() return _pStreamSocketImpl->getReceiveTimeout(); } - + } } // namespace Poco::Net