diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-09-07 01:23:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-09-07 01:23:03 +0000 |
commit | e62ff9383cbc100ef44eb315447853080b91ea63 (patch) | |
tree | 7e8cfbdabeaeca1fb79930e5e7ac0a32bc56e6d8 | |
parent | 4c87d38258852e556d73e159f8c477a99ccd6fde (diff) | |
download | libevent-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } } |