????????
????Boa ?????????????? WEB ??????????????????豸???
?????? Boa ???????????? CGI  ?????????????Щ????
?????????????? Boa ?? CGI ?? Status/Location ????????????????????.
?????汾: ???а汾 (0.94.13)
???????: BOA ???? CGI ????????????????? Status ?? Location
???????????:
????CGI/1.1 ????漲?? CGI ?????????? Status ???? HTTP ?????(?磬 Status: 500 Internal Error) ??
????Location ???е??????? (?磬 Location: www.xxx.com)?? ?????????????????е?λ??.
????Boa ??? Stauts ?? Location ?????????? ??????????????????? Stauts ?? Location ????????е?
????CGI ???. ???? CGI ????????????????? ??????? Boa ???Web Server ?????????.
?????????:
????ASP/PHP/JSP/Perl/... ??? header?? redirect?? ... ????????? Stauts/Location ???????????????
????????????. Boa ?????????? CGI ???????????????.
????????????(??Status/Location????????):
????Apache 1.3.x/2.x         IIS 4.x/5.x/6.X        Boa 0.9x                 thttpd                 mini-httpd
??????????                        ??????                * ???????                 ??????               ??????
??????????
??????????
????CGI ??ó???????????? ???? HTTP ?????????????. ?磬???????????????????????? C ?????
????HTTP/1.0: printf("Pragma: no-cache "); ??
????HTTP/1.1: printf("Cache-Control: no-cache; no-store ");
????????? ???????????????????????? Cookie ??????????(200 OK) ?????????
?????????????????? http ???????? CGI ???????????? "Status: " ?? "Loction: "??
??????Э??漲?? Web ??????????????????? "Status: " ?????????????? ??? "Location: " ???е???????
???????????????? "HTTP/1.0 302 Moved Temporarily " ?? "HTTP/1.1 302 Found ".
???????????????? CGI ????????λ??.
???????? Boa Source Code:
????cgi_header.c  Line 82-136 ???????? Boa ????? CGI ???????У? ???? "Status: "?? "Location: "?? ???????
23
24         int process_cgi_header(request * req)
25         {
26             char *buf;
27             char *c;
28
29             if (req->cgi_status != CGI_DONE)
30                 req->cgi_status = CGI_BUFFER;
31
32             buf = req->header_line;
33
34             c = strstr(buf?? " ");
35             if (c == NULL) {
36                 c = strstr(buf?? " ");
37                 if (c == NULL) {
38                     log_error_time();
39                     fputs("cgi_header: unable to find LFLF "?? stderr);
40         #ifdef FASCIST_LOGGING
41                     log_error_time();
42                     fprintf(stderr?? ""%s" "?? buf);
43         #endif
44                     send_r_bad_gateway(req);
45                     return 0;
46                 }
47             }
48             if (req->simple) {
49                 if (*(c + 1) == ' ')
50                     req->header_line = c + 2;
51                 else
52                     req->header_line = c + 1;
53                 return 1;
54             }
55             if (!strncasecmp(buf?? "Status: "?? 8)) {
56                 req->header_line--;
57                 memcpy(req->header_line?? "HTTP/1.0 "?? 9);
58             } else if (!strncasecmp(buf?? "Location: "?? 10)) { /* got a location header */
59         #ifdef FASCIST_LOGGING
60
61                 log_error_time();
62                 fprintf(stderr?? "%s:%d - found Location header "%s" "??
63                         __FILE__?? __LINE__?? buf + 10);
64         #endif
65
66
67                 if (buf[10] == '/') {   /* virtual path */
68                     log_error_time();
69                     fprintf(stderr??
70                             "server does not support internal redirection: "
71                             ""%s" "?? buf + 10);
72                     send_r_bad_request(req);
73
74                     /*
75                      * We (I?? Jon) have declined to support absolute-path parsing
76                      * because I see it as a major security hole.
77                      * Location: /etc/passwd or Location: /etc/shadow is not funny.
78                      *
79                      * Also?? the below code is borked.
80                      * request_uri could contain /cgi-bin/bob/extra_path
81                      */
82
83                     /*
84                        strcpy(req->request_uri?? buf + 10);
85                        return internal_redirect(req);
86                      */
87                 } else {                /* URL */
88                     char *c2;
89                     c2 = strchr(buf + 10?? ' ');
90                     /* c2 cannot ever equal NULL here because we already have found one */
91
92                     --c2;
93                     while (*c2 == ' ')
94                         --c2;
95                     ++c2;
96                     /* c2 now points to a ' ' or the ' ' */
97                     *c2++ = '

主站蜘蛛池模板: 免费观看黄a一级视频 | 任你躁欧美一级在线精品 | 日韩精品一区二区三区中文字幕 | 欧美一级特黄aa大片视频 | 成人啪精品视频免费网站 | 成人午夜影视全部免费看 | 中文字幕日韩精品亚洲七区 | 日本综合视频 | 亚洲精品无码专区在线播放 | 欧美日韩一区二区三区视频播 | 日本欧洲亚洲一区在线观看 | 一本大道香蕉高清视频在线 | 亚洲第一成网站 | 日韩51| 亚洲人成网址在线观看 | 天天干天天干天天操 | 极品蜜桃臀美女啪啪 | h片免费网站 | 欧美日本在线观看 | 一二三四视频社区在线播放中国 | 久久精品亚洲精品国产欧美 | 97国产精品人人爽人人做 | 在线观看永久免费 | 看黄网站在线播放 | 国产婷婷综合丁香亚洲欧洲 | 激情五月婷婷开心 | 国产成人福利精品视频 | 免费日韩在线 | 日本国产一区二区三区 | 免费观看成年的网站 | 在线观看免费视频一区 | 一级黄色片在线看 | 日韩精品成人免费观看 | 一级毛片免费在线 | 看免费一级片 | 日韩精品欧美激情亚洲综合 | 欧美高清亚洲欧美一区h | 国产三级在线看 | 久久久久久久久97 | 高清国产精品久久 | 在线播放 你懂的 |