Browse code

rtpengine: print command in log message on timeout

- few indentation fixes
- GH #1732

Surendra Tiwari authored on 21/11/2018 08:30:06 • Daniel-Constantin Mierla committed on 21/11/2018 08:30:06
Showing 1 changed files
... ...
@@ -2630,7 +2630,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2630 2630
 		}
2631 2631
 		v[0].iov_base = gencookie();
2632 2632
 		v[0].iov_len = strlen(v[0].iov_base);
2633
-        rtpengine_retr = cfg_get(rtpengine,rtpengine_cfg,rtpengine_retr);
2633
+		rtpengine_retr = cfg_get(rtpengine,rtpengine_cfg,rtpengine_retr);
2634 2634
 		for (i = 0; i < rtpengine_retr; i++) {
2635 2635
 			do {
2636 2636
 				len = writev(rtpp_socks[node->idx], v, vcnt + 1);
... ...
@@ -2640,14 +2640,14 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2640 2640
 				LM_ERR("can't send command \"%.*s\" to RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2641 2641
 				goto badproxy;
2642 2642
 			}
2643
-            rtpengine_tout_ms = cfg_get(rtpengine,rtpengine_cfg,rtpengine_tout_ms);
2643
+			rtpengine_tout_ms = cfg_get(rtpengine,rtpengine_cfg,rtpengine_tout_ms);
2644 2644
 			while ((poll(fds, 1, rtpengine_tout_ms) == 1) &&
2645 2645
 				(fds[0].revents & POLLIN) != 0) {
2646 2646
 				do {
2647 2647
 					len = recv(rtpp_socks[node->idx], buf, sizeof(buf)-1, 0);
2648 2648
 				} while (len == -1 && errno == EINTR);
2649 2649
 				if (len <= 0) {
2650
-					LM_ERR("can't read reply from RTP proxy <%s>\n", node->rn_url.s);
2650
+					LM_ERR("can't read reply for command \"%.*s\" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2651 2651
 					goto badproxy;
2652 2652
 				}
2653 2653
 				if (len >= (v[0].iov_len - 1) &&
... ...
@@ -2664,7 +2664,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen)
2664 2664
 			}
2665 2665
 		}
2666 2666
 		if (i == rtpengine_retr) {
2667
-			LM_ERR("timeout waiting reply from RTP proxy <%s>\n", node->rn_url.s);
2667
+			LM_ERR("timeout waiting reply for command \"%.*s\" from RTP proxy <%s>\n", out.len, out.s, node->rn_url.s);
2668 2668
 			goto badproxy;
2669 2669
 		}
2670 2670
 	}