If all content has been read in RTSP request, no need for waiting for next message

This commit is contained in:
loki
2021-07-04 16:06:03 +02:00
parent b346ac2eb0
commit 21b1a4a336
2 changed files with 16 additions and 3 deletions

View File

@@ -87,6 +87,13 @@ public:
if("Content-length"sv == option->option) {
BOOST_LOG(debug) << "Found Content-Length: "sv << option->content << " bytes"sv;
// If content_length > bytes read, then we need to store current data read,
// to be appended by the next read.
auto content_length = util::from_view(option->content);
if(content_length <= bytes) {
break;
}
auto incomplete_size = incomplete.size();
incomplete.resize(incomplete.size() + bytes);