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:
parent
cc492bf1a3
commit
708969c126
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user