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-10-21 19:34:38 +0400
committerIgor Sysoev <igor@sysoev.ru>2004-10-21 19:34:38 +0400
commitc0edbcce58b03b89c70f1eb39cb44c74c4c7453a (patch)
tree1ce72a5b51d724a0c054e079c2b1507ca85a145d /src/core/ngx_times.c
parentac64333a44f39d5a658832517a106961f32f6aae (diff)
nginx-0.1.2-RELEASE importrelease-0.1.2
*) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; the bug had appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; the bug had appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
Diffstat (limited to 'src/core/ngx_times.c')
-rw-r--r--src/core/ngx_times.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c
index 2ca31acc4..40dbbdbaf 100644
--- a/src/core/ngx_times.c
+++ b/src/core/ngx_times.c
@@ -212,12 +212,25 @@ 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;
ngx_gmtime(t, &tm);
+ return ngx_sprintf(buf, "%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);
+
+#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],
@@ -227,10 +240,14 @@ size_t ngx_http_time(u_char *buf, time_t t)
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;
@@ -241,6 +258,20 @@ size_t ngx_http_cookie_time(u_char *buf, time_t t)
* 2-digit years more than "37"
*/
+ return ngx_sprintf(buf,
+ (tm.ngx_tm_year > 2037) ?
+ "%s, %02d-%s-%d %02d:%02d:%02d 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 > 2037) ? tm.ngx_tm_year:
+ tm.ngx_tm_year % 100,
+ 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"),
@@ -264,6 +295,7 @@ size_t ngx_http_cookie_time(u_char *buf, time_t t)
tm.ngx_tm_min,
tm.ngx_tm_sec);
}
+#endif
}