Re: Example of Filter

yalcin Bozcaada (bozcaada@OpenMarket.com)
Thu, 20 Mar 1997 07:52:17 -0500

Message-Id: <3.0.32.19970320075216.009067d0@mail-199.openmarket.com>
Date: Thu, 20 Mar 1997 07:52:17 -0500
To: fastcgi-developers@OpenMarket.com
From: yalcin Bozcaada <bozcaada@OpenMarket.com>
Subject: Re: Example of Filter

Rujith,

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
    FCGI_StartFilterData();
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:

http://www.fastcgi.com/mail-archive/0485.html
   
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 <desilva@netbox.com>
>Reply-To: desilva@netbox.com
>Organization: Nets, Inc.
>X-Mailer: Mozilla 3.01Gold (Win95; I)
>MIME-Version: 1.0
>To: fastcgi-developers@OpenMarket.com
>Subject: Example of Filter
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>- -----BEGIN PGP SIGNED MESSAGE-----
>
>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.
>
>Later,
>Rujith.
>
>- -----BEGIN PGP SIGNATURE-----
>Version: 4.5
>
>iQCVAgUBMymHRYkharavxuYRAQHAYAP+PgCxCj79Y7NDlIm70eBDPqzRQY/0T/ka
>X9KXqf+vY0rJsqOSR+Bs6MhN368rdEDiJl/Xknkm17xmCPgV/WQOOZ4CbE7rfEQS
>HV4YGqAVazzXbl4ayN7S1ind8YfhesUzUKv1CT7bzSe8OgrIy08f7QoM6GmHOyT+
>oR0GOGEd/Eo=
>=N5qU
>- -----END PGP SIGNATURE-----
>
>------- End of Forwarded Message
>
>
>
>
>