Re: FCGI & problems

Lincoln Stein (
Mon, 12 Aug 1996 17:15:02 -0400

Date: Mon, 12 Aug 1996 17:15:02 -0400
Message-Id: <>
From: Lincoln Stein <>
To: "Rujith S. de Silva" <>
Subject: Re: FCGI & problems
In-Reply-To: <>

I've always been annoyed that I had to write that awful open(GGD,"-|")
hack in order to capture GD's gif files.  I should probably modify gd
myself in order to gain access to the internal data structures.


Rujith S. de Silva writes:
 > I claimed in an earlier message that I had successfully integrated
 > gd1.2, 1.00 and fcgi.  In fact, I had successfully compiled the
 > stuff so that the same perl binary could be used to generate gifs, or to
 > execute FCGI code.  However, trying to generate gifs from within FCGI
 > code doesn't work.  I'm looking at the problem - so far, this is what I
 > think:
 > gd writes the gifs it generates to STDOUT. uses open(GGD,"-|");
 > to fork a child process that generates the gif using gd and writes it to
 > STDOUT, and the parent process reads it in and converts it to a string.
 > gd attempts to flush characters as they're generated.  Somewhere during
 > this process, the following error is generated:
 > 	fflush returned nonzero result code.
 > I hope this is helpful.  I'm still trying to track down the problem.
 > Sorry for my mistaken claim of success in my prior email.
 > A suggestion: could gd be re-written or extended to return the result in
 > a (char *) buffer, rather than writing it to FILE * stdout?  This would
 > make much simpler and a lot more efficient.  Until them, is
 > going to fork a process for each gif it generates - this is VERY
 > inefficient, and makes it hardly worthwhile to integrate with
 > FCGI.
 > Later,
 > Rujith.