From d8df12f3369030d402233eca767624fab03bce4b Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Tue, 11 Oct 2022 09:16:23 +0200 Subject: [PATCH] Pass host along listen to h3 --- src/Http3App.h | 8 ++++---- src/Http3Context.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Http3App.h b/src/Http3App.h index 4be0234..4c54b29 100644 --- a/src/Http3App.h +++ b/src/Http3App.h @@ -37,7 +37,7 @@ namespace uWS { if (!host.length()) { return listen(port, std::move(handler)); } - handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr); + handler(http3Context ? (us_listen_socket_t *) http3Context->listen(host.c_str(), port) : nullptr); return std::move(*this); } @@ -46,19 +46,19 @@ namespace uWS { if (!host.length()) { return listen(port, options, std::move(handler)); } - handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr); + handler(http3Context ? (us_listen_socket_t *) http3Context->listen(host.c_str(), port) : nullptr); return std::move(*this); } /* Port, callback */ H3App &&listen(int port, MoveOnlyFunction &&handler) { - handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr); + handler(http3Context ? (us_listen_socket_t *) http3Context->listen(nullptr, port) : nullptr); return std::move(*this); } /* Port, options, callback */ H3App &&listen(int port, int options, MoveOnlyFunction &&handler) { - handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr); + handler(http3Context ? (us_listen_socket_t *) http3Context->listen(nullptr, port) : nullptr); return std::move(*this); } diff --git a/src/Http3Context.h b/src/Http3Context.h index 7863611..7cb18a8 100644 --- a/src/Http3Context.h +++ b/src/Http3Context.h @@ -107,9 +107,9 @@ namespace uWS { // call init here after setting the ext to Http3ContextData } - us_quic_listen_socket_t *listen(int port) { + us_quic_listen_socket_t *listen(const char *host, int port) { /* The listening socket is the actual UDP socket used */ - us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen((us_quic_socket_context_t *) this, "::", port, sizeof(Http3ResponseData)); + us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen((us_quic_socket_context_t *) this, host, port, sizeof(Http3ResponseData)); //printf("Listen socket is: %p\n", listen_socket);