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

https: use revectored time functions

parent c6dac3c6
...@@ -84,17 +84,22 @@ static struct vlc_http_msg *vlc_http_file_req(const struct vlc_http_file *file, ...@@ -84,17 +84,22 @@ 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"))) {
str = vlc_http_msg_get_header(file->resp, "ETag");
if (str != NULL)
{ {
if (!memcmp(str, "W/", 2)) if (!memcmp(str, "W/", 2))
str += 2; /* skip weak mark */ str += 2; /* skip weak mark */
vlc_http_msg_add_header(req, "If-Match", "%s", str); vlc_http_msg_add_header(req, "If-Match", "%s", str);
} }
else
if (file->resp != NULL {
&& (str = vlc_http_msg_get_header(file->resp, "Date"))) time_t mtime = vlc_http_msg_get_mtime(file->resp);
vlc_http_msg_add_header(req, "If-Unmodified-Since", "%s", str); if (mtime != -1)
vlc_http_msg_add_time(req, "If-Unmodified-Since", &mtime);
}
}
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)
......
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