diff --git a/examples/BroadcastingEchoServer.cpp b/examples/BroadcastingEchoServer.cpp index 7280f05..d8aee95 100644 --- a/examples/BroadcastingEchoServer.cpp +++ b/examples/BroadcastingEchoServer.cpp @@ -16,7 +16,7 @@ int main() { .idleTimeout = 10, .maxBackpressure = 1 * 1024 * 1204, /* Handlers */ - .open = [](auto *ws, auto *req) { + .open = [](auto *ws) { /* Let's make every connection subscribe to the "broadcast" topic */ ws->subscribe("broadcast"); }, diff --git a/examples/EchoServer.cpp b/examples/EchoServer.cpp index b0a35c8..3b73990 100644 --- a/examples/EchoServer.cpp +++ b/examples/EchoServer.cpp @@ -84,7 +84,7 @@ int main() { }, - .open = [](auto *ws, auto *req) { + .open = [](auto *ws) { /* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */ std::cout << "Something is: " << static_cast(ws->getUserData())->something << std::endl; }, diff --git a/examples/EchoServerThreaded.cpp b/examples/EchoServerThreaded.cpp index 2b596ef..a3cf9d9 100644 --- a/examples/EchoServerThreaded.cpp +++ b/examples/EchoServerThreaded.cpp @@ -22,7 +22,7 @@ int main() { .idleTimeout = 10, .maxBackpressure = 1 * 1024 * 1204, /* Handlers */ - .open = [](auto *ws, auto *req) { + .open = [](auto *ws) { }, .message = [](auto *ws, std::string_view message, uWS::OpCode opCode) { diff --git a/src/App.h b/src/App.h index 580ad03..3d08051 100644 --- a/src/App.h +++ b/src/App.h @@ -87,7 +87,7 @@ public: int idleTimeout = 120; int maxBackpressure = 1 * 1024 * 1024; fu2::unique_function *, HttpRequest *, struct us_socket_context_t *)> upgrade = nullptr; - fu2::unique_function *, HttpRequest *)> open = nullptr; + fu2::unique_function *)> open = nullptr; fu2::unique_function *, std::string_view, uWS::OpCode)> message = nullptr; fu2::unique_function *)> drain = nullptr; fu2::unique_function *)> ping = nullptr; diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 6b9f232..b06d956 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -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! diff --git a/src/WebSocketContextData.h b/src/WebSocketContextData.h index 30a27bd..477f448 100644 --- a/src/WebSocketContextData.h +++ b/src/WebSocketContextData.h @@ -34,7 +34,7 @@ template struct WebSocket; template struct WebSocketContextData { /* The callbacks for this context */ - fu2::unique_function *, HttpRequest *)> openHandler = nullptr; + fu2::unique_function *)> openHandler = nullptr; fu2::unique_function *, std::string_view, uWS::OpCode)> messageHandler = nullptr; fu2::unique_function *)> drainHandler = nullptr; fu2::unique_function *, int, std::string_view)> closeHandler = nullptr;