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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-06-14T08:44:35+02:00

cdp: log message when failing to set nonblock on socket

---

Modified: src/modules/cdp/receiver.c

---

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

---

diff --git a/src/modules/cdp/receiver.c b/src/modules/cdp/receiver.c
index dccfcd5bd29..9124c4eef49 100644
--- a/src/modules/cdp/receiver.c
+++ b/src/modules/cdp/receiver.c
@@ -949,7 +949,9 @@ int peer_connect(peer *p)
                { // Connect with timeout
                        int x;
                        x = fcntl(sock, F_GETFL, 0);
-                       fcntl(sock, F_SETFL, x | O_NONBLOCK);
+                       if(fcntl(sock, F_SETFL, x | O_NONBLOCK) < 0) {
+                               LM_WARN("failed to set O_NONBLOCK on socket 
%d\n", sock);
+                       }
                        int res = connect(sock, ainfo->ai_addr, 
ainfo->ai_addrlen);
                        if(res < 0) {
                                if(errno == EINPROGRESS) {

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to