Project

General

Profile

Feature #4881 » SAT-IP-Print-UDP-RTP-ports-in-connection-status.diff

Mono Polimorph, 2018-01-22 20:24

View differences:

src/satip/rtsp.c
1656 1656
static void
1657 1657
rtsp_stream_status ( void *opaque, htsmsg_t *m )
1658 1658
{
1659
  http_connection_t *hc = opaque;
1660
  char buf[128];
1659
  http_connection_t *hc = opaque;  char buf[128];
1660
  int buf_size = sizeof(buf);
1661
  struct session *rs = NULL;
1661 1662

  
1662 1663
  htsmsg_add_str(m, "type", "SAT>IP");
1663 1664
  if (hc->hc_proxy_ip) {
......
1666 1667
  }
1667 1668
  if (hc->hc_username)
1668 1669
    htsmsg_add_str(m, "user", hc->hc_username);
1670

  
1671
  buf[0]='\0';
1672
  TAILQ_FOREACH(rs, &rtsp_sessions, link) {
1673
    if (buf_size < 10) break;
1674
    if (hc->hc_session &&
1675
        strcmp(rs->session, hc->hc_session) == 0 &&
1676
        strcmp(rs->peer_ipstr, hc->hc_peer_ipstr) == 0 &&
1677
        rs->rtp_peer_port > 0) {
1678
      if (rs->rtp_peer_port == RTSP_TCP_DATA)
1679
        buf_size -= snprintf(buf + sizeof(buf) - buf_size, buf_size, "%sAVP", buf_size == sizeof(buf)? "" : ",");
1680
      else
1681
        buf_size -= snprintf(buf + sizeof(buf) - buf_size, buf_size, "%s%d+1", buf_size == sizeof(buf)? "" : ",", rs->rtp_peer_port);
1682
    }
1683
  }
1684
  if (buf[0] != '\0') {
1685
    htsmsg_set_str(m, "peer_udp_ports", buf);
1686
  }
1669 1687
}
1670 1688

  
1671 1689
/*
src/webui/static/app/status.js
607 607
                { name: 'server_port' },
608 608
                { name: 'peer', sortType: stype },
609 609
                { name: 'peer_port' },
610
                { name: 'peer_udp_ports' },
610 611
                { name: 'proxy' },
611 612
                { name: 'user', sortType: stype },
612 613
                {
......
645 646
            }, {
646 647
                width: 50,
647 648
                id: 'peer_port',
648
                header: _("Client Port"),
649
                header: _("Client TCP Port"),
649 650
                dataIndex: 'peer_port',
650 651
                sortable: true
651 652
            }, {
652 653
                width: 50,
654
                id: 'peer_udp_ports',
655
                header: _("Client UDP Ports"),
656
                dataIndex: 'peer_udp_ports',
657
                sortable: true
658
            }, {
659
                width: 50,
653 660
                id: 'user',
654 661
                header: _("Username"),
655 662
                dataIndex: 'user',
(1-1/4)