From 33968490b418e70869b9922c2c287814bf191710 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sun, 6 Sep 2020 12:38:01 +0200 Subject: [PATCH] Fix alert introduced in SNI example --- examples/ServerName.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ServerName.cpp b/examples/ServerName.cpp index 798e34c..8ca4511 100644 --- a/examples/ServerName.cpp +++ b/examples/ServerName.cpp @@ -2,7 +2,7 @@ /* Note that uWS::SSLApp({options}) is the same as uWS::App() when compiled without SSL support */ -struct us_listen_socket_t *listenSocket; +struct us_listen_socket_t *globalListenSocket; int main() { /* Overly simple hello world app (SNI) */ @@ -26,11 +26,11 @@ int main() { }).get("/exit", [](auto *res, auto *req) { res->end("Shutting down!"); /* We use this to check graceful closedown */ - us_listen_socket_close(1, listenSocket); + us_listen_socket_close(1, globalListenSocket); }).listen(3000, [](auto *listenSocket) { if (listenSocket) { std::cout << "Listening on port " << 3000 << std::endl; - ::listenSocket = listenSocket; + globalListenSocket = listenSocket; } else { std::cout << "Failed to listen on port 3000" << std::endl; }