[sr-dev] git:master:5f91017c: log_custom: check return code for udp send

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 18 09:23:13 CEST 2018


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-06-18T09:22:38+02:00

log_custom: check return code for udp send

---

Modified: src/modules/log_custom/log_custom_mod.c

---

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

---

diff --git a/src/modules/log_custom/log_custom_mod.c b/src/modules/log_custom/log_custom_mod.c
index f88a783b7c..e635baf75e 100644
--- a/src/modules/log_custom/log_custom_mod.c
+++ b/src/modules/log_custom/log_custom_mod.c
@@ -148,7 +148,9 @@ void _lc_core_log_udp(int lpriority, const char *format, ...)
 	n += snprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, "(%d) ", my_pid());
 	n += vsnprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, format, arglist);
 	va_end(arglist);
-	udp_send(&_lc_udp_dst, obuf, n);
+	if(udp_send(&_lc_udp_dst, obuf, n)!=0) {
+		LM_DBG("udp send returned non zero\n");
+	}
 }
 
 int ki_log_udp(sip_msg_t *msg, str *txt)




More information about the sr-dev mailing list