From 30d206d1c0254aea9a4fd0a8d06419a90de62e0d Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sun, 4 Dec 2016 13:38:30 +0100 Subject: [PATCH] jsonrpc: log message if rpc response fails to be sent via datagram --- modules/jsonrpc-s/jsonrpcs_sock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/jsonrpc-s/jsonrpcs_sock.c b/modules/jsonrpc-s/jsonrpcs_sock.c index 7dca3d23747..223dd05715c 100644 --- a/modules/jsonrpc-s/jsonrpcs_sock.c +++ b/modules/jsonrpc-s/jsonrpcs_sock.c @@ -530,6 +530,12 @@ static int jsonrpc_dgram_send_data(int fd, char* buf, unsigned int len, } /*LM_DBG("destination address length is %i\n", tolen);*/ n=sendto(fd, buf, len, 0, to, tolen); + if(n!=len) { + LM_ERR("failed to sent the response (%d - %d:%s)\n", + n, errno, strerror(errno)); + return n; + } + LM_DBG("rpc response sent out\n"); return n; }