Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-05-2009, 11:00 PM   #1
Registered: Oct 2008
Posts: 43

Rep: Reputation: 16
fastcgi issues

I'm working on a fastcgi program (actually, a binding to lua), and I'm running into trouble trying to receive data from stdin:

char *s, *l = getenv("CONTENT_LENGTH");	
	int k = atoi(l);
	fprintf(stderr, "Integer conversion successful."); 
	s = malloc(k);
	fgets(s, k, stdin);
I'm pretty damn sure that somewhere in here, fastcgi is crashing; all I do after this is print s to stdout with the appropriate headers (so far, at least).

error.log looks like this:

2009-09-05 23:54:57: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fastcgi process died): pid: 523 socket: unix:/var/run/lighttpd/lua-fastcgi.socket-3
2009-09-05 23:54:57: (mod_fastcgi.c.3326) response not received, request sent: 899 on socket: unix:/var/run/lighttpd/lua-fastcgi.socket-3 for /new_test.lua , closing connection

Anyone have any idea what's going wrong?

EDIT: WOW, I'm a moron. malloc(k * sizeof(char)), durr.
Anyone see any other problems with that code?

EDIT2: seeing as it's still not working, I assume there *are* other problems with it. I haven't used C in far too long, obviously.

Last edited by irkkaaja; 09-05-2009 at 11:04 PM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lighttpd + Fastcgi + ruby How? chutsu Linux - Server 0 08-17-2009 05:12 PM
FastCGI installation I_AM Linux - General 1 05-10-2009 05:30 AM
FastCGI etrader Linux - Newbie 0 03-28-2009 02:25 PM
PHP FastCGI security robertjinx Linux - Security 1 08-22-2008 02:56 AM
Ruby / Fastcgi Problem I_AM Linux - Software 1 03-09-2008 07:15 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration