diff options
author | Igor Sysoev <igor@sysoev.ru> | 2002-12-10 18:05:12 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2002-12-10 18:05:12 +0000 |
commit | b0869056bb4385a6b30fc58c653716c45ed33916 (patch) | |
tree | 8522c66320ee59e4671f23058a971d9556d1a6a0 /src/http/ngx_http_parse_time.c | |
parent | ef259d140f378be8d7936d04038354a93cccb461 (diff) | |
download | nginx-b0869056bb4385a6b30fc58c653716c45ed33916.tar.gz nginx-b0869056bb4385a6b30fc58c653716c45ed33916.zip |
nginx-0.0.1-2002-12-10-21:05:12 import
Diffstat (limited to 'src/http/ngx_http_parse_time.c')
-rw-r--r-- | src/http/ngx_http_parse_time.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse_time.c b/src/http/ngx_http_parse_time.c new file mode 100644 index 000000000..3e730a61a --- /dev/null +++ b/src/http/ngx_http_parse_time.c @@ -0,0 +1,64 @@ + +time_t ngx_http_parse_time() +{ + enum { + sw_start = 0, + } state; + + state = sw_start; + + while () { + switch (state) { + + case sw_start: + if (ch == ' ') { + ansi = 1; + state = sw_month; + + } else if (ch == ',') + state = sw_day_first_digit; + + break; + + case sw_day_first_digit: + if (ch == ' ') + break; + + if (ch >= '0' && ch <= '9') { + day = ch - '0'; + state = sw_day; + break; + + } + + return NGX_ERROR; + + case sw_day: + if (ansi && ch == ' ') { + state = sw_hour_first_digit; + break; + } + + if (ch >= '0' && ch <= '9') { + day = ch - '0'; + state = ansi ? sw_space_before_hour : sw_before_month; + break; + } + + return NGX_ERROR; + + case sw_before_month: + if (ch == ' ') { + rfc822 = 1; + } + + if (ch == '-') { + rfc850 = 1; + } + + case sw_space_before_hour: + + + } + } +} |