From 525c7e907bd4b99a146316b7a531f856ba2ec490 Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 8 Aug 2024 22:07:12 -0400 Subject: [PATCH] Code format --- httplib.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/httplib.h b/httplib.h index db69c02..4af592a 100644 --- a/httplib.h +++ b/httplib.h @@ -3372,9 +3372,7 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port, close_socket(sock); - if (quit) { - break; - } + if (quit) { break; } } freeaddrinfo(result); @@ -3475,7 +3473,7 @@ inline socket_t create_client_socket( time_t write_timeout_usec, const std::string &intf, Error &error) { auto sock = create_socket( host, ip, port, address_family, 0, tcp_nodelay, std::move(socket_options), - [&](socket_t sock2, struct addrinfo &ai, bool& quit) -> bool { + [&](socket_t sock2, struct addrinfo &ai, bool &quit) -> bool { if (!intf.empty()) { #ifdef USE_IF2IP auto ip_from_if = if2ip(address_family, intf); @@ -3500,9 +3498,7 @@ inline socket_t create_client_socket( error = wait_until_socket_is_ready(sock2, connection_timeout_sec, connection_timeout_usec); if (error != Error::Success) { - if (error == Error::ConnectionTimeout) { - quit = true; - } + if (error == Error::ConnectionTimeout) { quit = true; } return false; } } @@ -6481,7 +6477,7 @@ Server::create_server_socket(const std::string &host, int port, return detail::create_socket( host, std::string(), port, address_family_, socket_flags, tcp_nodelay_, std::move(socket_options), - [](socket_t sock, struct addrinfo &ai, bool& quit) -> bool { + [](socket_t sock, struct addrinfo &ai, bool & /*quit*/) -> bool { if (::bind(sock, ai.ai_addr, static_cast(ai.ai_addrlen))) { return false; }