Module: kamailio Branch: master Commit: 262068940ba8dbd1b9fd93847f83f40c038d988c URL: https://github.com/kamailio/kamailio/commit/262068940ba8dbd1b9fd93847f83f40c...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2019-07-15T12:37:54+02:00
rtpengine: fix error output on send_rtpp_command()
* rename out variable to cmd due to We already have an out goto label
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/262068940ba8dbd1b9fd93847f83f40c... Patch: https://github.com/kamailio/kamailio/commit/262068940ba8dbd1b9fd93847f83f40c...
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index a7b690f3fb..7a6b73d747 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -2770,7 +2770,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) static char buf[0x10000]; struct pollfd fds[1]; struct iovec *v; - str out = STR_NULL; + str cmd = STR_NULL;
v = bencode_iovec(dict, &vcnt, 1, 0); if (!v) { @@ -2835,8 +2835,9 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) len = writev(rtpp_socks[node->idx], v, vcnt + 1); } while (len == -1 && (errno == EINTR || errno == ENOBUFS)); if (len <= 0) { - bencode_get_str(bencode_dictionary_get(dict, "command"), &out); - LM_ERR("can't send command "%.*s" to RTP proxy <%s>\n", out.len, out.s, node->rn_url.s); + bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); + LM_ERR("can't send command "%.*s" to RTP proxy <%s>\n", + cmd.len, cmd.s, node->rn_url.s); goto badproxy; } rtpengine_tout_ms = cfg_get(rtpengine,rtpengine_cfg,rtpengine_tout_ms); @@ -2846,7 +2847,9 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) len = recv(rtpp_socks[node->idx], buf, sizeof(buf)-1, 0); } while (len == -1 && errno == EINTR); if (len <= 0) { - LM_ERR("can't read reply for command "%.*s" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s); + bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); + LM_ERR("can't read reply for command "%.*s" from RTP proxy <%s>\n", + cmd.len, cmd.s, node->rn_url.s); goto badproxy; } if (len >= (v[0].iov_len - 1) && @@ -2863,7 +2866,9 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) } } if (i == rtpengine_retr) { - LM_ERR("timeout waiting reply for command "%.*s" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s); + bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); + LM_ERR("timeout waiting reply for command "%.*s" from RTP proxy <%s>\n", + cmd.len, cmd.s, node->rn_url.s); goto badproxy; } }