Actions
Feature #4748
closedProxy info in webUI
Start date:
2017-11-28
Due date:
% Done:
100%
Estimated time:
Description
Hi Jarsolav,
This new patch adds the "proxy" info in the section "Status/Connection/Type" in the form of "SAT>IP (proxy)" and "HTTP (proxy)", instead of "SAT>IP" and "HTTP".
This info will be useful for differentiate proxy and non-proxy connections.
Please, can you commit this patch too?
Thank you
diff --git a/src/http.c b/src/http.c index 3c8d95a..9f246d9 100644 --- a/src/http.c +++ b/src/http.c @@ -1360,6 +1360,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)); @@ -1822,6 +1823,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; diff --git a/src/http.h b/src/http.h index a35c609..ce8096f 100644 --- a/src/http.h +++ b/src/http.h @@ -175,6 +175,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 */ diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 7cda53e..a81f725 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -1636,7 +1636,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); } diff --git a/src/webui/webui.c b/src/webui/webui.c index 6225405..d7589e9 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -357,7 +357,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); }
Files
Actions