Commit 51bd1874 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

https: use revectored time functions

parent c6dac3c6
...@@ -84,18 +84,23 @@ static struct vlc_http_msg *vlc_http_file_req(const struct vlc_http_file *file, ...@@ -84,18 +84,23 @@ static struct vlc_http_msg *vlc_http_file_req(const struct vlc_http_file *file,
if (file->referrer != NULL) /* TODO: validate URL */ if (file->referrer != NULL) /* TODO: validate URL */
vlc_http_msg_add_header(req, "Referer", "%s", file->referrer); vlc_http_msg_add_header(req, "Referer", "%s", file->referrer);
if (file->resp != NULL if (file->resp != NULL)
&& (str = vlc_http_msg_get_header(file->resp, "ETag")))
{ {
if (!memcmp(str, "W/", 2)) str = vlc_http_msg_get_header(file->resp, "ETag");
str += 2; /* skip weak mark */ if (str != NULL)
vlc_http_msg_add_header(req, "If-Match", "%s", str); {
if (!memcmp(str, "W/", 2))
str += 2; /* skip weak mark */
vlc_http_msg_add_header(req, "If-Match", "%s", str);
}
else
{
time_t mtime = vlc_http_msg_get_mtime(file->resp);
if (mtime != -1)
vlc_http_msg_add_time(req, "If-Unmodified-Since", &mtime);
}
} }
if (file->resp != NULL
&& (str = vlc_http_msg_get_header(file->resp, "Date")))
vlc_http_msg_add_header(req, "If-Unmodified-Since", "%s", str);
if (vlc_http_msg_add_header(req, "Range", "bytes=%ju-", offset) if (vlc_http_msg_add_header(req, "Range", "bytes=%ju-", offset)
&& offset != 0) && offset != 0)
goto error; goto error;
......
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