浏览代码

log_custom: check return code for udp send

(cherry picked from commit 5f91017c0393faa02201ccc3693fee6381ea691a)
(cherry picked from commit 0b9755011687685467e2d53cb4dcb0c58ea28688)
Daniel-Constantin Mierla 7 年之前
父节点
当前提交
735044314f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/modules/log_custom/log_custom_mod.c

+ 3 - 1
src/modules/log_custom/log_custom_mod.c

@@ -193,5 +193,7 @@ void _lc_core_log_udp(int lpriority, const char *format, ...)
 	n += snprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, "(%d) ", my_pid());
 	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);
 	n += vsnprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, format, arglist);
 	va_end(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");
+	}
 }
 }