Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-11-11 17:07:14 +0300
committerIgor Sysoev <igor@sysoev.ru>2004-11-11 17:07:14 +0300
commit1b73583ba2c0e4b72d951218827e0c621427d389 (patch)
tree9e4d204e2cce91560d5cb8908b8a1a9f2c1d92ee /src/core/ngx_times.c
parentd6f24959428caed68a509a19ca4fd866d978a69c (diff)
nginx-0.1.5-RELEASE importrelease-0.1.5
*) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
Diffstat (limited to 'src/core/ngx_times.c')
-rw-r--r--src/core/ngx_times.c85
1 files changed, 19 insertions, 66 deletions
diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c
index 40dbbdbaf..f06d64476 100644
--- a/src/core/ngx_times.c
+++ b/src/core/ngx_times.c
@@ -94,7 +94,7 @@ void ngx_time_init()
ngx_old_elapsed_msec = 0;
ngx_elapsed_msec = 0;
-#if !(WIN32)
+#if !(NGX_WIN32)
tzset();
#endif
@@ -150,15 +150,14 @@ void ngx_time_update(time_t s)
p = cached_http_time[slot];
- ngx_snprintf((char *) p, sizeof("Mon, 28 Sep 1970 06:00:00 GMT"),
- "%s, %02d %s %4d %02d:%02d:%02d GMT",
- week[ngx_cached_gmtime.ngx_tm_wday],
- ngx_cached_gmtime.ngx_tm_mday,
- months[ngx_cached_gmtime.ngx_tm_mon - 1],
- ngx_cached_gmtime.ngx_tm_year,
- ngx_cached_gmtime.ngx_tm_hour,
- ngx_cached_gmtime.ngx_tm_min,
- ngx_cached_gmtime.ngx_tm_sec);
+ ngx_sprintf(p, "%s, %02d %s %4d %02d:%02d:%02d GMT",
+ week[ngx_cached_gmtime.ngx_tm_wday],
+ ngx_cached_gmtime.ngx_tm_mday,
+ months[ngx_cached_gmtime.ngx_tm_mon - 1],
+ ngx_cached_gmtime.ngx_tm_year,
+ ngx_cached_gmtime.ngx_tm_hour,
+ ngx_cached_gmtime.ngx_tm_min,
+ ngx_cached_gmtime.ngx_tm_sec);
ngx_cached_http_time.data = p;
@@ -183,24 +182,22 @@ void ngx_time_update(time_t s)
p = cached_err_log_time[slot];
- ngx_snprintf((char *) p, sizeof("1970/09/28 12:00:00"),
- "%4d/%02d/%02d %02d:%02d:%02d",
- tm.ngx_tm_year, tm.ngx_tm_mon,
- tm.ngx_tm_mday, tm.ngx_tm_hour,
- tm.ngx_tm_min, tm.ngx_tm_sec);
+ ngx_sprintf(p, "%4d/%02d/%02d %02d:%02d:%02d",
+ tm.ngx_tm_year, tm.ngx_tm_mon,
+ tm.ngx_tm_mday, tm.ngx_tm_hour,
+ tm.ngx_tm_min, tm.ngx_tm_sec);
ngx_cached_err_log_time.data = p;
p = cached_http_log_time[slot];
- ngx_snprintf((char *) p, sizeof("28/Sep/1970:12:00:00 +0600"),
- "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",
- tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
- tm.ngx_tm_year, tm.ngx_tm_hour,
- tm.ngx_tm_min, tm.ngx_tm_sec,
- ngx_gmtoff < 0 ? '-' : '+',
- abs(ngx_gmtoff / 60), abs(ngx_gmtoff % 60));
+ ngx_sprintf(p, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",
+ tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
+ tm.ngx_tm_year, tm.ngx_tm_hour,
+ tm.ngx_tm_min, tm.ngx_tm_sec,
+ ngx_gmtoff < 0 ? '-' : '+',
+ abs(ngx_gmtoff / 60), abs(ngx_gmtoff % 60));
ngx_cached_http_log_time.data = p;
@@ -213,9 +210,6 @@ void ngx_time_update(time_t s)
u_char *ngx_http_time(u_char *buf, time_t t)
-#if 0
-size_t ngx_http_time(u_char *buf, time_t t)
-#endif
{
ngx_tm_t tm;
@@ -229,25 +223,10 @@ size_t ngx_http_time(u_char *buf, time_t t)
tm.ngx_tm_hour,
tm.ngx_tm_min,
tm.ngx_tm_sec);
-
-#if 0
- return ngx_snprintf((char *) buf, sizeof("Mon, 28 Sep 1970 06:00:00 GMT"),
- "%s, %02d %s %4d %02d:%02d:%02d GMT",
- week[tm.ngx_tm_wday],
- tm.ngx_tm_mday,
- months[tm.ngx_tm_mon - 1],
- tm.ngx_tm_year,
- tm.ngx_tm_hour,
- tm.ngx_tm_min,
- tm.ngx_tm_sec);
-#endif
}
u_char *ngx_http_cookie_time(u_char *buf, time_t t)
-#if 0
-size_t ngx_http_cookie_time(u_char *buf, time_t t)
-#endif
{
ngx_tm_t tm;
@@ -270,32 +249,6 @@ size_t ngx_http_cookie_time(u_char *buf, time_t t)
tm.ngx_tm_hour,
tm.ngx_tm_min,
tm.ngx_tm_sec);
-
-#if 0
- if (tm.ngx_tm_year > 2037) {
- return ngx_snprintf((char *) buf,
- sizeof("Mon, 28-Sep-1970 06:00:00 GMT"),
- "%s, %02d-%s-%d %02d:%02d:%02d GMT",
- week[tm.ngx_tm_wday],
- tm.ngx_tm_mday,
- months[tm.ngx_tm_mon - 1],
- tm.ngx_tm_year,
- tm.ngx_tm_hour,
- tm.ngx_tm_min,
- tm.ngx_tm_sec);
- } else {
- return ngx_snprintf((char *) buf,
- sizeof("Mon, 28-Sep-70 06:00:00 GMT"),
- "%s, %02d-%s-%02d %02d:%02d:%02d GMT",
- week[tm.ngx_tm_wday],
- tm.ngx_tm_mday,
- months[tm.ngx_tm_mon - 1],
- tm.ngx_tm_year % 100,
- tm.ngx_tm_hour,
- tm.ngx_tm_min,
- tm.ngx_tm_sec);
- }
-#endif
}