Bug #2237
closedOnly half output
Description
Hi,
I use lighttpd with mod_fastcgi. The example code is written in C. It uses libpq-fe.
I put a String into the database (dump attached) which cause a weird behaviour. I read everything out of "message.stdlib_comments" and print it out. Lets say i would like to print:
asdf1
asdf2
asdf3
lighttpd only prints
f1
asdf2
asdf3
Why? i doesn't know. For me, there is nothing special. It seams he starts printing after an special char. If you excecute the code without lighttpd (only ./whatever), it prints the correct stuff.
Tested under FreeBSD 8.0 and Gentoo with lighttpd version 1.4.26.
Compile the attached code with:
gcc -lfcgi -lpq index.c -o index
postgresql needs an role called pgsql. No password.
On my system, the binary is called index.c. It's not a bug in *.conf
Files
Updated by nitrox over 14 years ago
- Status changed from New to Need Feedback
- Priority changed from High to Normal
"high" is reserved for critical stuff, this doesn´t sound like it.
Try to debug your fcgi, e.g. attach strace to it.
Updated by postal over 14 years ago
Ok here is the code without postgres. Maybe it's easier to test it. Only fcgi loop and printf. Nothing else.
The same output works fine with php.
I'm not familiar with bugtrackers. Sry for wrong priority.
Updated by postal over 14 years ago
Sure i can delete every \r but thats not the right way. Imho it is a bug in fcgi or lighttpd.
Updated by darix over 14 years ago
postal wrote:
Sure i can delete every \r but thats not the right way. Imho it is a bug in fcgi or lighttpd.
he said use \r\n instead of \n. so this
printf("Content-type: text/html\n\n");
becomes
printf("Content-type: text/html\r\n\r\n");
Updated by icy over 14 years ago
- Status changed from Need Feedback to Invalid
No, you should not remove \r but ADD. You use \n\n instead of \r\n\r\n. Did you look at the fastcgi examples on fastcgi.com?
http://www.fastcgi.com/devkit/examples/echo.c
Your stuff does not output valid HTTP responses.
Also available in: Atom