Compile bug (#122)

* 1) IXWebSocketTransport: BUG: int type has no warranty of number of bits. It depends on compiler and architecture. In my system (64 bit) is 32 bit.
1 << 63 is bad idea in this case because the final number is 0 by overflow.
The symptom observed is that the server can't receive messages.

2) IXSocketFactory: Compilation Warning: Variable not in use.

* Better aproach suggested by Benjamin.
This commit is contained in:
fcojavmc 2019-11-20 20:12:24 +01:00 committed by Benjamin Sergeant
parent cc492bf1a3
commit 708969c126
2 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ namespace ix
std::string& errorMsg, std::string& errorMsg,
const SocketTLSOptions& tlsOptions) const SocketTLSOptions& tlsOptions)
{ {
(void) tlsOptions;
errorMsg.clear(); errorMsg.clear();
std::shared_ptr<Socket> socket; std::shared_ptr<Socket> socket;

View File

@ -543,7 +543,7 @@ namespace ix
} }
// Prevent integer overflow in the next conditional // Prevent integer overflow in the next conditional
const uint64_t maxFrameSize(1 << 63); const uint64_t maxFrameSize(1ULL << 63);
if (ws.N > maxFrameSize) if (ws.N > maxFrameSize)
{ {
return; return;