Clean-up and fix HttpResponse::cork behavior

This commit is contained in:
Alex Hultman
2019-12-26 17:17:33 +01:00
parent bdac60a177
commit 3fb870ac55
2 changed files with 13 additions and 13 deletions
+3 -2
View File
@@ -218,12 +218,13 @@ private:
return nullptr;
});
// basically we need to uncork in all cases, except for nullptr
/* We need to uncork in all cases, except for nullptr (closed socket, or upgraded socket) */
if (returnedSocket != nullptr) {
/* Timeout on uncork failure */
auto [written, failed] = ((AsyncSocket<SSL> *) returnedSocket)->uncork();
if (failed) {
// do we have the same timeout for websockets?
/* All Http sockets timeout by this, and this behavior match the one in HttpResponse::cork */
/* Warning: both HTTP_IDLE_TIMEOUT_S and HTTP_TIMEOUT_S are 10 seconds and both are used the same */
((AsyncSocket<SSL> *) s)->timeout(HTTP_IDLE_TIMEOUT_S);
}