vendor : update cpp-httplib to 0.40.0 (#21100)

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët 2026-03-28 08:59:44 +01:00 committed by GitHub
parent 0eb4764182
commit b0f0dd3e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 119 additions and 52 deletions

View file

@ -113,16 +113,10 @@ bool server_http_context::init(const common_params & params) {
srv->set_read_timeout (params.timeout_read);
srv->set_write_timeout(params.timeout_write);
srv->set_socket_options([reuse_port = params.reuse_port](socket_t sock) {
int opt = 1;
#ifdef _WIN32
const char * optval = (const char *)&opt;
#else
const void * optval = &opt;
#endif
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, optval, sizeof(opt));
httplib::set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
if (reuse_port) {
#ifdef SO_REUSEPORT
setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, optval, sizeof(opt));
httplib::set_socket_opt(sock, SOL_SOCKET, SO_REUSEPORT, 1);
#else
LOG_WRN("%s: SO_REUSEPORT is not supported\n", __func__);
#endif