Merge branch 'master' into cgi_preview

This commit is contained in:
Adam D. Ruppe 2020-09-27 21:59:17 -04:00
commit 46ae18e112
1 changed files with 5 additions and 1 deletions

View File

@ -2813,6 +2813,7 @@ class WebSocket {
private WebSocketFrame processOnce() { private WebSocketFrame processOnce() {
ubyte[] d = receiveBuffer[0 .. receiveBufferUsedLength]; ubyte[] d = receiveBuffer[0 .. receiveBufferUsedLength];
//import std.stdio; writeln(d);
auto s = d; auto s = d;
// FIXME: handle continuation frames more efficiently. it should really just reuse the receive buffer. // FIXME: handle continuation frames more efficiently. it should really just reuse the receive buffer.
WebSocketFrame m; WebSocketFrame m;
@ -2876,7 +2877,10 @@ class WebSocket {
default: // ignore though i could and perhaps should throw too default: // ignore though i could and perhaps should throw too
} }
} }
receiveBufferUsedLength -= s.length - d.length;
import core.stdc.string;
memmove(receiveBuffer.ptr, d.ptr, d.length);
receiveBufferUsedLength = d.length;
return m; return m;
} }