]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
show http/rtsp proxy info in the status
authorJaroslav Kysela <perex@perex.cz>
Thu, 11 Jan 2018 15:11:51 +0000 (16:11 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 11 Jan 2018 15:11:55 +0000 (16:11 +0100)
From: Mono Polimorph

src/http.c
src/http.h
src/satip/rtsp.c
src/webui/webui.c

index f741992bcc8607ce7407edf29f3288c13c606420..64c4d01447fefec6c7cfe4e384afed29ae322726 100644 (file)
@@ -1361,6 +1361,7 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill)
       http_error(hc, HTTP_STATUS_BAD_REQUEST);
       return -1;
     }
+    hc->hc_is_proxied = 1;
   }
 
   tcp_get_str_from_ip(hc->hc_peer, authbuf, sizeof(authbuf));
@@ -1857,6 +1858,7 @@ http_serve_requests(http_connection_t *hc)
   atomic_set(&hc->hc_extra_insend, 0);
   atomic_set(&hc->hc_extra_chunks, 0);
 
+  hc->hc_is_proxied = 0;
   do {
     hc->hc_no_output  = 0;
 
index 86b09602286737134b12bb205e4cba69bac8c903..480e5b772236a715ab4860d290c51f0697715bb0 100644 (file)
@@ -176,6 +176,7 @@ typedef struct http_connection {
   uint8_t hc_no_output;
   uint8_t hc_shutdown;
   uint8_t hc_is_local_ip;   /*< a connection from the local network */
+  uint8_t hc_is_proxied;
 
   /* Support for HTTP POST */
   
index 01c4bc5391398fe4775d772bce92a43ae31e024a..71ab9a202db7c439b6ad4dcd10e25141d2683edd 100644 (file)
@@ -1656,7 +1656,7 @@ static void
 rtsp_stream_status ( void *opaque, htsmsg_t *m )
 {
   http_connection_t *hc = opaque;
-  htsmsg_add_str(m, "type", "SAT>IP");
+  htsmsg_add_str(m, "type", (hc->hc_is_proxied)? "SAT>IP/proxy" : "SAT>IP");
   if (hc->hc_username)
     htsmsg_add_str(m, "user", hc->hc_username);
 }
index 5c212186f1cccfcfb2d95d42d3d3d483ca36664c..97924ad7383aab1f6fcb9e28eb6c6a296bab394b 100644 (file)
@@ -291,7 +291,7 @@ static void
 http_stream_status ( void *opaque, htsmsg_t *m )
 {
   http_connection_t *hc = opaque;
-  htsmsg_add_str(m, "type", "HTTP");
+  htsmsg_add_str(m, "type", (hc->hc_is_proxied)? "HTTP/proxy" : "HTTP");
   if (hc->hc_username)
     htsmsg_add_str(m, "user", hc->hc_username);
 }