Re: Example of Filter

yalcin Bozcaada (
Thu, 20 Mar 1997 07:52:17 -0500

Message-Id: <>
Date: Thu, 20 Mar 1997 07:52:17 -0500
From: yalcin Bozcaada <>
Subject: Re: Example of Filter


A filtering program will have only a few differences from the responder.
(as far as programming it goes)

here is what those are and the C examples.:

1- when the filter program is activated, you must finish stdin buffer.
    while (EOF != getc(stdin));
2- Then you must call filtering function once
3- Now you are pointing to whatever needs to be filtered, and it is in stdin.
   you can read stdin and put into your buffer to play with.
    fread((void *)(CharBuffer), 1, (size_t)MaxBufferSize, stdin);
4- At this point, your data is in CharBuffer. You can manipulate it the way
you want             to filter
5- the next step is writing out to the server, which is on stdout.
Of course these are all happening inside FCGI_Accept() loop. 
thats it.

As for an example, I had already sent one some time ago. You can find it in
fcgi mail archive at:
I am sorry, it is not in Perl, it is in C. 

-yalcin Bozcaada 
At 12:34 PM 3/19/97 -0500, you wrote:
>------- Forwarded Message
>From: Rujith de Silva <>
>Organization: Nets, Inc.
>X-Mailer: Mozilla 3.01Gold (Win95; I)
>MIME-Version: 1.0
>Subject: Example of Filter
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>I want to write a FastCGI program to act as a Filter, and would like
>some example code.  The FastCGI distribution didn't seem to have any
>example Filter code.  Would you send me a little working Filter
>program, please?  Perl preferred, C or Java okay.
>Version: 4.5
>- -----END PGP SIGNATURE-----
>------- End of Forwarded Message