mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
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:
parent
117c9bd978
commit
7eb31c852d
4 changed files with 280 additions and 160 deletions
|
|
@ -39,6 +39,12 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header);
|
|||
|
||||
#endif /* CURL_DISABLE_RTSP */
|
||||
|
||||
typedef enum {
|
||||
RTP_PARSE_SKIP,
|
||||
RTP_PARSE_CHANNEL,
|
||||
RTP_PARSE_LEN,
|
||||
RTP_PARSE_DATA
|
||||
} rtp_parse_st;
|
||||
/*
|
||||
* RTSP Connection data
|
||||
*
|
||||
|
|
@ -47,6 +53,9 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header);
|
|||
struct rtsp_conn {
|
||||
struct dynbuf buf;
|
||||
int rtp_channel;
|
||||
size_t rtp_len;
|
||||
rtp_parse_st state;
|
||||
BIT(in_header);
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue