Mercurial > hg > nginx-vendor-0-6
annotate src/os/unix/ngx_time.c @ 70:8ad297c88dcb NGINX_0_1_35
nginx 0.1.35
*) Feature: the "working_directory" directive.
*) Feature: the "port_in_redirect" directive.
*) Bugfix: the segmentation fault was occurred if the backend response
header was in several packets; bug appeared in 0.1.29.
*) Bugfix: if more than 10 servers were configured or some server did
not use the "listen" directive, then the segmentation fault was
occurred on the start.
*) Bugfix: the segmentation fault might occur if the response was
bigger than the temporary file.
*) Bugfix: nginx returned the 400 response on requests like
"GET http://www.domain.com/uri HTTP/1.0"; bug appeared in 0.1.28.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 07 Jun 2005 00:00:00 +0400 |
parents | 818201e5a553 |
children | 408f195b3482 |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
11 void ngx_localtime(ngx_tm_t *tm) | |
12 { | |
18 | 13 #if (NGX_HAVE_LOCALTIME_R) |
0 | 14 time_t now; |
15 | |
16 now = ngx_time(); | |
66 | 17 (void) localtime_r(&now, tm); |
0 | 18 |
19 #else | |
20 time_t now; | |
21 ngx_tm_t *t; | |
22 | |
23 now = ngx_time(); | |
24 t = localtime(&now); | |
25 *tm = *t; | |
26 | |
27 #endif | |
28 | |
29 tm->ngx_tm_mon++; | |
30 tm->ngx_tm_year += 1900; | |
31 } | |
58 | 32 |
33 | |
34 void ngx_libc_localtime(struct tm *tm) | |
35 { | |
36 #if (NGX_HAVE_LOCALTIME_R) | |
37 time_t now; | |
38 | |
39 now = ngx_time(); | |
66 | 40 (void) localtime_r(&now, tm); |
58 | 41 |
42 #else | |
43 time_t now; | |
44 struct tm *t; | |
45 | |
46 now = ngx_time(); | |
47 t = localtime(&now); | |
48 *tm = *t; | |
49 | |
50 #endif | |
51 } | |
52 | |
53 | |
54 void ngx_libc_gmtime(struct tm *tm) | |
55 { | |
56 #if (NGX_HAVE_LOCALTIME_R) | |
57 time_t now; | |
58 | |
59 now = ngx_time(); | |
66 | 60 (void) gmtime_r(&now, tm); |
58 | 61 |
62 #else | |
63 time_t now; | |
64 struct tm *t; | |
65 | |
66 now = ngx_time(); | |
67 t = gmtime(&now); | |
68 *tm = *t; | |
69 | |
70 #endif | |
71 } |