Abort logic fixes

This commit is contained in:
Alex Hultman
2018-10-28 02:08:01 +01:00
parent 99d73a9d65
commit 4059dd644c
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ private:
std::cout << "Close event!" << std::endl;
/* Signal broken HTTP request */
/* Signal broken HTTP request only if we have a pending request */
if (httpResponseData->onAborted) {
httpResponseData->onAborted();
}
+7
View File
@@ -105,6 +105,13 @@ private:
Super::timeout(HTTP_TIMEOUT_S);
}
/* Remove onAborted function if we reach the end */
if (httpResponseData->offset == totalSize) {
httpResponseData->onAborted = nullptr;
/* Also remove onWritable so that we do not emit when draining behind the scenes. */
httpResponseData->onWritable = nullptr;
}
return success;
}
}