RTSP: improved RTP parser

- fix HTTP header parsing to report incomplete
  lines it buffers as consumed!
- re-implement the RTP parser for interleave RTP
  messages for robustness. It is now keeping its
  state at the connection
- RTSP protocol handler "readwrite" implementation
  now tracks if the response is before/in/after
  header parsing or "in" a bod by calling
  "Curl_http_readwrite_headers()" itself. This
  allows it to know when non-RTP bytes are "junk"
  or HEADER or BODY.
- tested with #12035 and various small receive
  sizes where current master fails

Closes #12052
This commit is contained in:
Stefan Eissing 2023-10-07 15:13:09 +02:00 committed by Daniel Stenberg
parent 117c9bd978
commit 7eb31c852d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 280 additions and 160 deletions

View file

@ -3986,6 +3986,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
char *end_ptr;
/* header line within buffer loop */
*stop_reading = FALSE;
do {
size_t rest_length;
size_t full_length;
@ -4023,7 +4024,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
break;
}
}
*nread = 0;
break; /* read more and try again */
}