From e11e92a37e4c3b71e1f2facdbc8e0c7231d7770f Mon Sep 17 00:00:00 2001 From: yhirose Date: Sun, 1 Sep 2024 07:47:21 -0400 Subject: [PATCH] Adjust the place where socket_options is called --- httplib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httplib.h b/httplib.h index fcce072..d5f9e6c 100644 --- a/httplib.h +++ b/httplib.h @@ -3371,8 +3371,6 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port, #endif } - if (socket_options) { socket_options(sock); } - if (rp->ai_family == AF_INET6) { auto opt = ipv6_v6only ? 1 : 0; #ifdef _WIN32 @@ -3384,6 +3382,8 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port, #endif } + if (socket_options) { socket_options(sock); } + // bind or connect auto quit = false; if (bind_or_connect(sock, *rp, quit)) {