Actions
Bug #4753
closedSAT>IP server: Correct RTSP Traces
Start date:
2017-11-30
Due date:
% Done:
100%
Estimated time:
Found in version:
head
Affected Versions:
Description
Hi Jaroslav,
This patch solves the problem of TRACING the debug of RTSP commands. As the current code of the HTTP server and the RTSP server shares code, then you can only TRACE RTSP commands enabling the trace of the http module. However, if you do this, then you see the webUI requests.
So, this simple patch solves this distinguishing between HTTP and RTSP.
Please, commit this patch as it's very unconfortable to debug/trace the satip_server without seeying the RTSP commands.
Regards.
diff --git a/src/http.c b/src/http.c index b6ef09b..28b65f6 100644 --- a/src/http.c +++ b/src/http.c @@ -1196,7 +1196,7 @@ destroy: * Dump request */ static void -dump_request(http_connection_t *hc) +dump_request(http_connection_t *hc, int mode) { char buf[2048] = ""; http_arg_t *ra; @@ -1216,7 +1216,7 @@ dump_request(http_connection_t *hc) if (!first) tvh_strlcatf(buf, sizeof(buf), ptr, "}}"); - tvhtrace(LS_HTTP, "%s %s %s%s", http_ver2str(hc->hc_version), + tvhtrace((mode) ? LS_SATIPS : LS_HTTP, "%s %s %s%s", http_ver2str(hc->hc_version), http_cmd2str(hc->hc_cmd), hc->hc_url, buf); } @@ -1244,7 +1244,7 @@ http_cmd_get(http_connection_t *hc) char *args; if (tvhtrace_enabled()) - dump_request(hc); + dump_request(hc,0); if (!http_resolve(hc, &hp, &remain, &args)) { http_error(hc, HTTP_STATUS_NOT_FOUND); @@ -1310,7 +1310,7 @@ http_cmd_post(http_connection_t *hc, htsbuf_queue_t *spill) } if (tvhtrace_enabled()) - dump_request(hc); + dump_request(hc,0); if (!http_resolve(hc, &hp, &remain, &args)) { http_error(hc, HTTP_STATUS_NOT_FOUND); @@ -1450,7 +1450,7 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill) switch(hc->hc_version) { case RTSP_VERSION_1_0: if (tvhtrace_enabled()) - dump_request(hc); + dump_request(hc,1); if (hc->hc_cseq) rval = hc->hc_process(hc, spill); else
Files
Actions