|
目前我尝试着在at91rm9200上运行boa.问题是我写的CGI程序在PC LINUX上能运行,在9200上运行不了! 查出是boa中这个函数输出的错误。
int process_cgi_header(request * req)
{
char *buf;
char *c;
if (req->cgi_status != CGI_DONE)
req->cgi_status = CGI_BUFFER;
buf = req->header_line;
c = strstr(buf, "\n\r\n");
if (c == NULL) {
c = strstr(buf, "\n\n");
if (c == NULL) {
log_error_time();
fputs("cgi_header: unable to find LFLF\n", stderr);
#ifdef FASCIST_LOGGING
log_error_time();
fprintf(stderr, "\"%s\"\n", buf);
#endif
send_r_error(req);//输出500 server error ...
return 0;
}
...
}
从程序来看,应该是判断CGI输出的头文件出错,没有\n\r\n或者\n\n,但是我的CGI输出中,有语句:
printf("Content-type:text/html\n\n");而且在PC Linux下能正常运行,不知道嵌入式Linux跟PC Linux哪里有区别导致了这个问题。
请大家指点一下,不胜感激! |
|