Make onAborted unique_function
This commit is contained in:
@@ -67,8 +67,6 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}).run();
|
||||
|
||||
/* This is needed to properly free default loop and such resources */
|
||||
uWS::destroy();
|
||||
|
||||
std::cout << "Everything fine, falling through" << std::endl;
|
||||
|
||||
|
||||
+2
-2
@@ -239,10 +239,10 @@ public:
|
||||
}
|
||||
|
||||
/* Attach handler for aborted HTTP request */
|
||||
HttpResponse *onAborted(std::function<void()> handler) {
|
||||
HttpResponse *onAborted(fu2::unique_function<void()> &&handler) {
|
||||
HttpResponseData<SSL> *httpResponseData = getHttpResponseData();
|
||||
|
||||
httpResponseData->onAborted = handler;
|
||||
httpResponseData->onAborted = std::move(handler);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ private:
|
||||
|
||||
/* Per socket event handlers */
|
||||
fu2::unique_function<bool(int)> onWritable;
|
||||
std::function<void()> onAborted;
|
||||
fu2::unique_function<void()> onAborted;
|
||||
//std::function<void()> onData;
|
||||
|
||||
std::function<void(std::string_view, bool)> inStream;
|
||||
|
||||
Reference in New Issue
Block a user