From 3a60c0492fee64339688ebfacf68b41ef117ca4a Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Thu, 4 Jun 2020 09:12:39 -0700 Subject: [PATCH] Change to RTSP client to accept also an empty Content-Type. In this case application/sdp is assumed. --- daemon/rtsp_client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/rtsp_client.cpp b/daemon/rtsp_client.cpp index eb92b4a..c421c18 100644 --- a/daemon/rtsp_client.cpp +++ b/daemon/rtsp_client.cpp @@ -96,6 +96,7 @@ RtspResponse read_response(tcp::iostream& s, uint16_t max_length) { std::copy_n(std::istreambuf_iterator(s), res.content_length, std::back_inserter(res.body)); } + BOOST_LOG_TRIVIAL(debug) << "rtsp_client:: body " << res.body; return res; } @@ -164,7 +165,8 @@ std::pair RtspClient::process( return std::make_pair(false, rtsp_source); } - if (res.content_type.rfind("application/sdp", 0) == std::string::npos) { + if (!res.content_type.empty() && + res.content_type.rfind("application/sdp", 0) == std::string::npos) { BOOST_LOG_TRIVIAL(error) << "rtsp_client:: unsupported content-type " << res.content_type << " from " << "rtsp://" << address << ":" << port << path;