Begin restoring WebSocket performance

This commit is contained in:
Alex Hultman
2018-12-21 02:13:44 +01:00
parent 819a78976e
commit 3e75936387
3 changed files with 44 additions and 12 deletions
+18
View File
@@ -71,6 +71,24 @@ protected:
getLoopData()->corked = true;
}
// this is highly broken right now, should properly make use of secondary buffer if needed
std::pair<char *, bool> getSendBuffer(size_t size) {
// for now, just return this straight up
LoopData *loopData = getLoopData();
char *sendBuffer = loopData->corkBuffer + loopData->corkOffset;
// very broken
loopData->corkOffset += size;
return {sendBuffer, false};
}
/* Write in three levels of prioritization: cork-buffer, syscall, socket-buffer. Always drain if possible.
* Returns pair of bytes written (anywhere) and wheter or not this call resulted in the polling for
* writable (or we are in a state that implies polling for writable). */