Module: kamailio
Branch: master
Commit: ad8f017b38e90746790ec9789f01abe6fab46e1b
URL: 
https://github.com/kamailio/kamailio/commit/ad8f017b38e90746790ec9789f01abe6fab46e1b

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-02-06T08:26:22+01:00

nghttp2: check return for setsockopt TCP_NODELAY

---

Modified: src/modules/nghttp2/nghttp2_server.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/ad8f017b38e90746790ec9789f01abe6fab46e1b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ad8f017b38e90746790ec9789f01abe6fab46e1b.patch

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 3b8816aca0c..79b81a20c01 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -202,7 +202,10 @@ static http2_session_data *create_http2_session_data(
        session_data = malloc(sizeof(http2_session_data));
        memset(session_data, 0, sizeof(http2_session_data));
        session_data->app_ctx = app_ctx;
-       setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val));
+       if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val))
+                       < 0) {
+               LM_ERR("failed to set TCP_NODELAY socket option\n");
+       }
        session_data->bev = bufferevent_openssl_socket_new(app_ctx->evbase, fd, 
ssl,
                        BUFFEREVENT_SSL_ACCEPTING,
                        BEV_OPT_CLOSE_ON_FREE | BEV_OPT_DEFER_CALLBACKS);

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to