aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-18 13:35:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-18 13:35:59 +0000
commitf1becea682b563d366add102cd88431f15182b26 (patch)
treeddb0f320ccddad22add4ff5425c53c3dd70696cb /src/libutil/http.c
parentc1c7b9c63d6d2cdf5c42443b7a9c8c80bae49162 (diff)
downloadrspamd-f1becea682b563d366add102cd88431f15182b26.tar.gz
rspamd-f1becea682b563d366add102cd88431f15182b26.zip
[Minor] Use own localtime/gmtime
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r--src/libutil/http.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index 9e3e2f2a1..5732f8b8e 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -1745,15 +1745,14 @@ rspamd_http_message_write_header (const gchar* mime_type, gboolean encrypted,
{
gchar datebuf[64];
gint meth_len = 0;
- struct tm t, *ptm;
+ struct tm t;
if (conn->type == RSPAMD_HTTP_SERVER) {
/* Format reply */
if (msg->method < HTTP_SYMBOLS) {
rspamd_ftok_t status;
- ptm = gmtime (&msg->date);
- t = *ptm;
+ rspamd_gmtime (msg->date, &t);
rspamd_snprintf (datebuf, sizeof(datebuf),
"%s, %02d %s %4d %02d:%02d:%02d GMT", http_week[t.tm_wday],
t.tm_mday, http_month[t.tm_mon], t.tm_year + 1900,
@@ -3689,7 +3688,7 @@ rspamd_http_date_format (gchar *buf, gsize len, time_t time)
{
struct tm tms;
- tms = *gmtime (&time);
+ rspamd_gmtime (time, &tms);
return rspamd_snprintf (buf, len, "%s, %02d %s %4d %02d:%02d:%02d GMT",
http_week[tms.tm_wday], tms.tm_mday,