From: Jaroslav Kysela Date: Sat, 24 Feb 2018 17:59:24 +0000 (+0100) Subject: SATIP server: changes for VLC 3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7e2fed2c3ffd52423e0a96876ad31953063b16a;p=thirdparty%2Ftvheadend.git SATIP server: changes for VLC 3 --- diff --git a/src/http.c b/src/http.c index 59d91e24c..7232f2930 100644 --- a/src/http.c +++ b/src/http.c @@ -659,9 +659,10 @@ http_error(http_connection_t *hc, int error) level = LOG_DEBUG; else if (error == HTTP_STATUS_BAD_REQUEST || error > HTTP_STATUS_UNAUTHORIZED) level = LOG_ERR; - tvhlog(level, hc->hc_subsys, "%s: %s %s %s -- %d", + if (hc->hc_cmd == 6 && strstr(hc->hc_url, "&pids")) abort(); + tvhlog(level, hc->hc_subsys, "%s: %s %s (%d) %s -- %d", hc->hc_peer_ipstr, http_ver2str(hc->hc_version), - http_cmd2str(hc->hc_cmd), hc->hc_url, error); + http_cmd2str(hc->hc_cmd), hc->hc_cmd, hc->hc_url, error); } if (hc->hc_version != RTSP_VERSION_1_0) { @@ -1386,19 +1387,16 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill) case RTSP_VERSION_1_0: hc->hc_keep_alive = 1; /* Extract CSeq */ - if((v = http_arg_get(&hc->hc_args, "CSeq")) != NULL) + if((v = http_arg_get(&hc->hc_args, "CSeq")) != NULL) { hc->hc_cseq = strtoll(v, NULL, 10); - else + } else { hc->hc_cseq = 0; + } free(hc->hc_session); if ((v = http_arg_get(&hc->hc_args, "Session")) != NULL) hc->hc_session = tvh_strdupa(v); else hc->hc_session = NULL; - if(hc->hc_cseq == 0) { - http_error(hc, HTTP_STATUS_BAD_REQUEST); - return -1; - } break; case HTTP_VERSION_1_0: @@ -1458,10 +1456,7 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill) case RTSP_VERSION_1_0: if (tvhtrace_enabled()) dump_request(hc); - if (hc->hc_cseq) - rval = hc->hc_process(hc, spill); - else - http_error(hc, HTTP_STATUS_HTTP_VERSION); + rval = hc->hc_process(hc, spill); break; case HTTP_VERSION_1_0: diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 50086d156..cfab4fdb8 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -1081,6 +1081,8 @@ rtsp_parse_cmd rs->rtp_peer_port = r; rs->frontend = fe > 0 ? fe : 1; } else { + if (!rs && !stream && cmd == RTSP_CMD_DESCRIBE) + rs = rtsp_new_session(hc->hc_peer_ipstr, msys, 0, -1); if (!rs || stream != rs->stream) { if (rs) errcode = HTTP_STATUS_NOT_FOUND; @@ -1358,7 +1360,8 @@ rtsp_describe_session(session_t *rs, htsbuf_queue_t *q) { char buf[4096]; - htsbuf_qprintf(q, "a=control:stream=%d\r\n", rs->stream); + if (rs->stream > 0) + htsbuf_qprintf(q, "a=control:stream=%d\r\n", rs->stream); htsbuf_qprintf(q, "a=tool:%s\r\n", config_get_http_server_name()); htsbuf_append_str(q, "m=video 0 RTP/AVP 33\r\n"); if (strchr(rtsp_ip, ':'))