onData as unique_function
This commit is contained in:
+2
-2
@@ -247,9 +247,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Attach a read handler for data sent. Will be called with FIN set true if last segment. */
|
/* 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();
|
HttpResponseData<SSL> *data = getHttpResponseData();
|
||||||
data->inStream = handler;
|
data->inStream = std::move(handler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ private:
|
|||||||
fu2::unique_function<void()> onAborted;
|
fu2::unique_function<void()> onAborted;
|
||||||
//std::function<void()> onData;
|
//std::function<void()> onData;
|
||||||
|
|
||||||
std::function<void(std::string_view, bool)> inStream;
|
fu2::unique_function<void(std::string_view, bool)> inStream;
|
||||||
std::function<std::pair<bool, std::string_view>(int)> outStream;
|
//std::function<std::pair<bool, std::string_view>(int)> outStream;
|
||||||
/* Outgoing offset */
|
/* Outgoing offset */
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user