Add experimental HttpResponse::cork

This commit is contained in:
Alex Hultman
2019-04-16 16:59:28 +02:00
parent c1ea38ae10
commit 799fe89a9b
2 changed files with 27 additions and 0 deletions
+5
View File
@@ -69,6 +69,11 @@ struct AsyncSocket {
return getLoopData()->corkedSocket == this;
}
/* Returns whether we could cork (it is free) */
bool canCork() {
return getLoopData()->corkedSocket == nullptr;
}
/* Returns a suitable buffer for temporary assemblation of send data */
std::pair<char *, bool> getSendBuffer(size_t size) {
/* If we are corked and we have room, return the cork buffer itself */