2011-02-09 09:02:08     boa and cgihtml problem

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-02-09 09:02:08     boa and cgihtml problem

Yuriy Urasinov (RUSSIAN FEDERATION)

Message: 98027   

 

I use boa web server and cgihtml for scripts on ucLinux 2010R1-RC5.  I write cgi on C.

 

I try to run scripts from cgi-bin directory on my hardware console. It works very good. For example my script "uart" sends data to UART0 (UART1 is connectod to console).

 

But when I try to run this script from web browser I see error

 

502 Bad Gateway

The CGI was not CGI/1.1 compliant.

 

 

And message in console

 

request "POST /cgi-bin/uart HTTP/1.1" ("./uart"): cgi_header: unable to find LFLF

 

What is is?

 

I also try to write script on C with "hello world" message only. It also works only in console.

QuoteReplyEditDelete

 

 

2011-02-09 10:18:06     Re: boa and cgihtml problem

Mike Frysinger (UNITED STATES)

Message: 98033   

 

your output must be compliant meaning you must include HTTP headers.  please read the documentation:

  docs.blackfin.uclinux.org/doku.php?id=cgi_hello_world

QuoteReplyEditDelete

 

 

2011-02-10 01:13:46     Re: boa and cgihtml problem

Yuriy Urasinov (RUSSIAN FEDERATION)

Message: 98038   

 

Thank you. My scripts work.

 

Why this

 

printf("Content-type: text/html\r\n");

printf("\r\n");

 

 

and this

 

printf("Content-type: text/html\r\n\r\n");

 

is not same?

 

I used function html_header() from user/cgihtml/html-lib.c

 

this function

 

void html_header(){

 

printf("Content-type: text/html\r\n");

 

}

QuoteReplyEditDelete

Attachments

    Outcomes