Merge pull request #53 from ratchetphp/cap-frame-size-#41
Ensure max[Message|Frame]PayloadSize is int if auto-set
This commit is contained in:
commit
ebe17ed644
@ -117,10 +117,10 @@ class MessageBuffer {
|
|||||||
$memory_limit_bytes = static::getMemoryLimit();
|
$memory_limit_bytes = static::getMemoryLimit();
|
||||||
|
|
||||||
if ($maxMessagePayloadSize === null) {
|
if ($maxMessagePayloadSize === null) {
|
||||||
$maxMessagePayloadSize = $memory_limit_bytes / 4;
|
$maxMessagePayloadSize = (int)($memory_limit_bytes / 4);
|
||||||
}
|
}
|
||||||
if ($maxFramePayloadSize === null) {
|
if ($maxFramePayloadSize === null) {
|
||||||
$maxFramePayloadSize = $memory_limit_bytes / 4;
|
$maxFramePayloadSize = (int)($memory_limit_bytes / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_int($maxFramePayloadSize) || $maxFramePayloadSize > 0x7FFFFFFFFFFFFFFF || $maxFramePayloadSize < 0) { // this should be interesting on non-64 bit systems
|
if (!is_int($maxFramePayloadSize) || $maxFramePayloadSize > 0x7FFFFFFFFFFFFFFF || $maxFramePayloadSize < 0) { // this should be interesting on non-64 bit systems
|
||||||
|
Loading…
Reference in New Issue
Block a user