summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-09-07 01:23:03 +0000
committerNick Mathewson <nickm@torproject.org>2007-09-07 01:23:03 +0000
commite62ff9383cbc100ef44eb315447853080b91ea63 (patch)
tree7e8cfbdabeaeca1fb79930e5e7ac0a32bc56e6d8
parent4c87d38258852e556d73e159f8c477a99ccd6fde (diff)
downloadlibevent-e62ff9383cbc100ef44eb315447853080b91ea63.tar.gz
r14982@catbus: nickm | 2007-09-06 21:22:52 -0400
Backport: use gmtime rather than gmtime_r on win32. svn:r415
-rw-r--r--http.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/http.c b/http.c
index c6d3ed23..af550252 100644
--- a/http.c
+++ b/http.c
@@ -346,11 +346,16 @@ evhttp_make_header_response(struct evhttp_connection *evcon,
if (evhttp_find_header(req->output_headers,
"Date") == NULL) {
char date[50];
- struct tm cur;
+ struct tm cur, *cur_p;
time_t t = time(NULL);
+#ifdef WIN32
+ cur_p = gmtime(&t);
+#else
gmtime_r(&t, &cur);
+ cur_p = &cur;
+#endif
if (strftime(date, sizeof(date),
- "%a, %d %b %Y %H:%M:%S GMT", &cur) != 0) {
+ "%a, %d %b %Y %H:%M:%S GMT", cur_p) != 0) {
evhttp_add_header(req->output_headers, "Date", date);
}
}