Browse code

rtpengine: fix error output on send_rtpp_command()

* rename out variable to cmd due to We already have an out goto label

Victor Seva authored on 15/07/2019 10:09:00
Showing 1 changed files
... ...
@@ -2770,7 +2770,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2770 2770
 	static char buf[0x10000];
2771 2771
 	struct pollfd fds[1];
2772 2772
 	struct iovec *v;
2773
-	str out = STR_NULL;
2773
+	str cmd = STR_NULL;
2774 2774
 
2775 2775
 	v = bencode_iovec(dict, &vcnt, 1, 0);
2776 2776
 	if (!v) {
... ...
@@ -2835,8 +2835,9 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2835 2835
 				len = writev(rtpp_socks[node->idx], v, vcnt + 1);
2836 2836
 			} while (len == -1 && (errno == EINTR || errno == ENOBUFS));
2837 2837
 			if (len <= 0) {
2838
-				bencode_get_str(bencode_dictionary_get(dict, "command"), &out);
2839
-				LM_ERR("can't send command \"%.*s\" to RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2838
+				bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd);
2839
+				LM_ERR("can't send command \"%.*s\" to RTP proxy <%s>\n",
2840
+					cmd.len, cmd.s, node->rn_url.s);
2840 2841
 				goto badproxy;
2841 2842
 			}
2842 2843
 			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)
2846 2846
 					len = recv(rtpp_socks[node->idx], buf, sizeof(buf)-1, 0);
2847 2847
 				} while (len == -1 && errno == EINTR);
2848 2848
 				if (len <= 0) {
2849
-					LM_ERR("can't read reply for command \"%.*s\" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2849
+					bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd);
2850
+					LM_ERR("can't read reply for command \"%.*s\" from RTP proxy <%s>\n",
2851
+						cmd.len, cmd.s, node->rn_url.s);
2850 2852
 					goto badproxy;
2851 2853
 				}
2852 2854
 				if (len >= (v[0].iov_len - 1) &&
... ...
@@ -2863,7 +2866,9 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2863 2863
 			}
2864 2864
 		}
2865 2865
 		if (i == rtpengine_retr) {
2866
-			LM_ERR("timeout waiting reply for command \"%.*s\" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2866
+			bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd);
2867
+			LM_ERR("timeout waiting reply for command \"%.*s\" from RTP proxy <%s>\n",
2868
+				cmd.len, cmd.s, node->rn_url.s);
2867 2869
 			goto badproxy;
2868 2870
 		}
2869 2871
 	}