Module: kamailio Branch: master Commit: 30d206d1c0254aea9a4fd0a8d06419a90de62e0d URL: https://github.com/kamailio/kamailio/commit/30d206d1c0254aea9a4fd0a8d06419a9...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-12-04T22:07:56+01:00
jsonrpc: log message if rpc response fails to be sent via datagram
---
Modified: modules/jsonrpc-s/jsonrpcs_sock.c
---
Diff: https://github.com/kamailio/kamailio/commit/30d206d1c0254aea9a4fd0a8d06419a9... Patch: https://github.com/kamailio/kamailio/commit/30d206d1c0254aea9a4fd0a8d06419a9...
---
diff --git a/modules/jsonrpc-s/jsonrpcs_sock.c b/modules/jsonrpc-s/jsonrpcs_sock.c index 7dca3d2..223dd05 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; }