Good morning, I'm trying to debug a small cgi program and having a lot of trouble. It's throwing an exception in the constructor for CgiEnvironment (that's called from the constructor from Cgicc). This is the first executable step in my program :( It tries to read 60 chars from cin (CONTENT_LENGTH=60) and the read method returns 0 characters read. This is during a POST operation. I don't know if it's the compiler, cgicc, or the web server. Calling the same cgi manually without the POST works ok so it appears to be just that one path through the code. It really looks like there's nothing in stdin, or something has read it already. Any suggestions?
OS: Gentoo linux, Webserver: Lighttpd, compiler: gcc --version: gcc (GCC) 3.3.5 (Gentoo Hardened Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) I modified the page to post to a shell script to get the environment and it looks just fine: HTTP_CONTENT_LENGTH=60 HTTP_KEEP_ALIVE=300 HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.13) Gecko/20060414 HTTP_HOST=www.xxxx.net SERVER_PORT=80 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 DOCUMENT_ROOT=/home/httpd/html/ SCRIPT_FILENAME=/home/httpd/html/cgi-bin/env.cgi REQUEST_URI=/cgi-bin/env.cgi SCRIPT_NAME=/cgi-bin/env.cgi HTTP_CONNECTION=keep-alive REMOTE_PORT=51437 PWD=/home/httpd/html/cgi-bin REDIRECT_STATUS=200 HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.8,ko;q=0.5,ja;q=0.3 HTTP_REFERER=http://www.xxxxxxxxx.net/xchg/test.html HTTP_ACCEPT=application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1 REMOTE_ADDR=67.52.227.92 SHLVL=1 SERVER_NAME=www.xxxxx.net CONTENT_LENGTH=60 SERVER_SOFTWARE=lighttpd/1.4.13 SERVER_ADDR=xxx.52.227.xxx GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 HTTP_ACCEPT_ENCODING=gzip,deflate CONTENT_TYPE=application/x-www-form-urlencoded HTTP_COOKIE=__utma=56827945.1428697664.1160696041.1160696041.1160696041.1; __utmb=56827945; __utmc=56827945; __utmz=56827945.1160696041.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) REQUEST_METHOD=POST _=/bin/env // hex dump of stdin 0000000 65 6d 61 69 6c 3d 26 64 65 73 63 3d 26 6e 6f 74 e m a i l = & d e s c = & n o t 0000020 31 3d 26 6e 6f 74 32 3d 26 6e 6f 74 33 3d 26 6e 1 = & n o t 2 = & n o t 3 = & n 0000040 6f 74 34 3d 26 6e 6f 74 35 3d 26 73 77 61 70 3d o t 4 = & n o t 5 = & s w a p = 0000060 32 30 30 36 67 69 66 74 73 77 61 70 2 0 0 6 g i f t s w a p 0000074 -- Cthulhu Bucks: http://www.CthulhuBucks.com/ _______________________________________________ help-cgicc mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cgicc
