onData as unique_function

This commit is contained in:
Alex Hultman
2019-01-17 08:21:39 +01:00
parent 2a62218d2a
commit 04281eeea6
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -247,9 +247,9 @@ public:
}
/* Attach a read handler for data sent. Will be called with FIN set true if last segment. */
void onData(std::function<void(std::string_view, bool)> handler) {
void onData(fu2::unique_function<void(std::string_view, bool)> &&handler) {
HttpResponseData<SSL> *data = getHttpResponseData();
data->inStream = handler;
data->inStream = std::move(handler);
}
};
+2 -2
View File
@@ -47,8 +47,8 @@ private:
fu2::unique_function<void()> onAborted;
//std::function<void()> onData;
std::function<void(std::string_view, bool)> inStream;
std::function<std::pair<bool, std::string_view>(int)> outStream;
fu2::unique_function<void(std::string_view, bool)> inStream;
//std::function<std::pair<bool, std::string_view>(int)> outStream;
/* Outgoing offset */
int offset = 0;