mirror of https://github.com/adamdruppe/arsd.git
Merge branch 'master' of github.com:adamdruppe/arsd
This commit is contained in:
commit
db2ca76e60
9
http2.d
9
http2.d
|
@ -3545,6 +3545,15 @@ class WebSocket {
|
||||||
public bool lowLevelReceive() {
|
public bool lowLevelReceive() {
|
||||||
if(readyState == CONNECTING)
|
if(readyState == CONNECTING)
|
||||||
throw new Exception("WebSocket not connected when trying to receive. Did you forget to call connect(); ?");
|
throw new Exception("WebSocket not connected when trying to receive. Did you forget to call connect(); ?");
|
||||||
|
if (receiveBufferUsedLength == receiveBuffer.length)
|
||||||
|
{
|
||||||
|
if (receiveBuffer.length == config.maximumReceiveBufferSize)
|
||||||
|
throw new Exception("Maximum receive buffer size exhausted");
|
||||||
|
|
||||||
|
import std.algorithm : min;
|
||||||
|
receiveBuffer.length = min(receiveBuffer.length + config.initialReceiveBufferSize,
|
||||||
|
config.maximumReceiveBufferSize);
|
||||||
|
}
|
||||||
auto r = socket.receive(receiveBuffer[receiveBufferUsedLength .. $]);
|
auto r = socket.receive(receiveBuffer[receiveBufferUsedLength .. $]);
|
||||||
if(r == 0)
|
if(r == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue