Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/cpp-httplib/httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -3163,13 +3163,13 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port,
if (socket_options) { socket_options(sock); }

if (rp->ai_family == AF_INET6) {
auto no = 0;
auto yes = 1;
#ifdef _WIN32
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
reinterpret_cast<const char *>(&no), sizeof(no));
reinterpret_cast<const char *>(&yes), sizeof(yes));
#else
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
reinterpret_cast<const void *>(&no), sizeof(no));
reinterpret_cast<const void *>(&yes), sizeof(yes));
#endif
}

Expand Down