Project

General

Profile

Actions

Bug #2237

closed

Only half output

Added by postal over 14 years ago. Updated over 14 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_fastcgi
Target version:
-
ASK QUESTIONS IN Forums:

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

index.c (988 Bytes) index.c postal, 2010-07-13 21:16
backup.tar (27 KB) backup.tar postal, 2010-07-13 21:16
bsd.lighttpd.conf (11.4 KB) bsd.lighttpd.conf postal, 2010-07-13 21:16
gentoo.lighttpd.conf (8.05 KB) gentoo.lighttpd.conf postal, 2010-07-13 21:16
gentoo.mod_fastcgiconf (851 Bytes) gentoo.mod_fastcgiconf postal, 2010-07-13 21:16
hexdump (1.96 KB) hexdump postal, 2010-07-13 21:16
new.c (251 Bytes) new.c postal, 2010-07-13 23:53
test.php (74 Bytes) test.php postal, 2010-07-13 23:53
strace (9.46 KB) strace postal, 2010-07-13 23:53
Actions #1

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.

Actions #3

Updated by Olaf-van-der-Spek over 14 years ago

Try \r\n\r\n instead of \n\n

Actions #4

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.

Actions #5

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");

Actions #6

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.

Actions #7

Updated by stbuehler over 14 years ago

  • Target version deleted (1.4.x)
Actions

Also available in: Atom