Skip to content

Commit

Permalink
lib/fetch: switch to gmtime_r
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncaen committed Feb 7, 2021
1 parent fb58a30 commit 72cb9e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fetch/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
{
char timebuf[80];
char hbuf[URL_HOSTLEN + 7], *host;
struct tm timestruct;
conn_t *conn;
struct url *url, *new;
int chunked, direct, ims, keep_alive, noredirect, verbose;
Expand All @@ -1605,7 +1606,6 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
const char *p;
fetchIO *f;
hdr_t h;
struct tm *timestruct;
http_headerbuf_t headerbuf;
http_auth_challenges_t server_challenges;
http_auth_challenges_t proxy_challenges;
Expand Down Expand Up @@ -1679,9 +1679,9 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
}

if (ims && url->ims_time) {
timestruct = gmtime((time_t *)&url->ims_time);
gmtime_r(&url->ims_time, &timestruct);
(void)strftime(timebuf, 80, "%a, %d %b %Y %T GMT",
timestruct);
&timestruct);
if (verbose)
fetch_info("If-Modified-Since: %s", timebuf);
http_cmd(conn, "If-Modified-Since: %s", timebuf);
Expand Down

0 comments on commit 72cb9e7

Please sign in to comment.