Leave just one call to gmtime() in http_MakeMessage().

This commit is contained in:
Marcelo Roberto Jimenez 2011-01-02 22:36:13 -02:00
parent 8997e7fff6
commit 39fd869db8

View File

@ -1633,14 +1633,14 @@ int http_MakeMessage(membuffer *buf, int http_major_version,
start_str = "DATE: "; start_str = "DATE: ";
end_str = "\r\n"; end_str = "\r\n";
curr_time = time(NULL); curr_time = time(NULL);
date = gmtime(&curr_time); loc_time = &curr_time;
} else { } else {
/* date value only */ /* date value only */
start_str = end_str = ""; start_str = end_str = "";
loc_time = (time_t *)va_arg(argp, time_t *); loc_time = (time_t *)va_arg(argp, time_t *);
assert(loc_time);
date = gmtime(loc_time);
} }
assert(loc_time);
date = gmtime(loc_time);
sprintf(tempbuf, sprintf(tempbuf,
"%s%s, %02d %s %d %02d:%02d:%02d GMT%s", "%s%s, %02d %s %d %02d:%02d:%02d GMT%s",
start_str, &weekday_str[date->tm_wday * 4], start_str, &weekday_str[date->tm_wday * 4],