Commit 4fb4df7b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

message: size is unknown if Transfer-Encoding is present

This is not really an issue with HTTP/2 as framing specifies the end of
the stream explicitly. This would become a problem with HTTP/1, notably
with chunked encoding.
parent 59865335
...@@ -699,7 +699,11 @@ uintmax_t vlc_http_msg_get_size(const struct vlc_http_msg *m) ...@@ -699,7 +699,11 @@ uintmax_t vlc_http_msg_get_size(const struct vlc_http_msg *m)
|| m->status == 304 /* Not Modified */) || m->status == 304 /* Not Modified */)
return 0; return 0;
const char *str = vlc_http_msg_get_header(m, "Content-Length"); const char *str = vlc_http_msg_get_header(m, "Transfer-Encoding");
if (str != NULL) /* Transfer-Encoding preempts Content-Length */
return -1;
str = vlc_http_msg_get_header(m, "Content-Length");
if (str == NULL) if (str == NULL)
{ {
if (m->status < 0) if (m->status < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment