comparison src/http/ngx_http_parse_time.c @ 24:77c7629a2627

nginx-0.0.1-2002-12-10-21:05:12 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 10 Dec 2002 18:05:12 +0000
parents
children a8b156554dfe
comparison
equal deleted inserted replaced
23:f540a63026c9 24:77c7629a2627
1
2 time_t ngx_http_parse_time()
3 {
4 enum {
5 sw_start = 0,
6 } state;
7
8 state = sw_start;
9
10 while () {
11 switch (state) {
12
13 case sw_start:
14 if (ch == ' ') {
15 ansi = 1;
16 state = sw_month;
17
18 } else if (ch == ',')
19 state = sw_day_first_digit;
20
21 break;
22
23 case sw_day_first_digit:
24 if (ch == ' ')
25 break;
26
27 if (ch >= '0' && ch <= '9') {
28 day = ch - '0';
29 state = sw_day;
30 break;
31
32 }
33
34 return NGX_ERROR;
35
36 case sw_day:
37 if (ansi && ch == ' ') {
38 state = sw_hour_first_digit;
39 break;
40 }
41
42 if (ch >= '0' && ch <= '9') {
43 day = ch - '0';
44 state = ansi ? sw_space_before_hour : sw_before_month;
45 break;
46 }
47
48 return NGX_ERROR;
49
50 case sw_before_month:
51 if (ch == ' ') {
52 rfc822 = 1;
53 }
54
55 if (ch == '-') {
56 rfc850 = 1;
57 }
58
59 case sw_space_before_hour:
60
61
62 }
63 }
64 }