Don't pass req in open handler

This commit is contained in:
Alex Hultman
2020-06-02 12:59:36 +02:00
parent 6735bad79c
commit 625efbc499
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ public:
int idleTimeout = 120;
int maxBackpressure = 1 * 1024 * 1024;
fu2::unique_function<void(HttpResponse<SSL> *, HttpRequest *, struct us_socket_context_t *)> upgrade = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *, HttpRequest *)> open = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *)> open = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *, std::string_view, uWS::OpCode)> message = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *)> drain = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *)> ping = nullptr;
+1 -1
View File
@@ -270,7 +270,7 @@ public:
/* Emit open event and start the timeout */
if (webSocketContextData->openHandler) {
webSocketContextData->openHandler(webSocket, /*req*/ nullptr);
webSocketContextData->openHandler(webSocket);
}
// if we weren't corked then uncork here! otherwise we were called from httpContext!
+1 -1
View File
@@ -34,7 +34,7 @@ template <bool, bool> struct WebSocket;
template <bool SSL>
struct WebSocketContextData {
/* The callbacks for this context */
fu2::unique_function<void(uWS::WebSocket<SSL, true> *, HttpRequest *)> openHandler = nullptr;
fu2::unique_function<void(uWS::WebSocket<SSL, true> *)> openHandler = nullptr;
fu2::unique_function<void(WebSocket<SSL, true> *, std::string_view, uWS::OpCode)> messageHandler = nullptr;
fu2::unique_function<void(WebSocket<SSL, true> *)> drainHandler = nullptr;
fu2::unique_function<void(WebSocket<SSL, true> *, int, std::string_view)> closeHandler = nullptr;