Re: fastCGI, memory leaks etc

Michael Smith (mjs@cursci.co.uk)
Mon, 19 Aug 1996 15:23:49 +0100

Message-Id: <321878F5.4B081A7D@cursci.co.uk>
Date: Mon, 19 Aug 1996 15:23:49 +0100
From: Michael Smith <mjs@cursci.co.uk>
To: fastcgi-developers@openmarket.com
Subject: Re: fastCGI, memory leaks etc

The boy Nigel wrote:

>Exit your process explicitly after n connections - something like 
>this at the end of the loop
>
>        if (count++ > 100)
>               exit(0);
>
>The problem with your code is first you accepted the connection, then 
>you dumped out of the processing loop.

I have tried achieving the desired effect with the following piece of
perl:

my($count)=0;

while (FCGI::accept() >= 0) {
  $count++;
   print "Content-type: text/html\n\nCount=$count\n";
   if ($count > 3) {
     exit(0);
     }
}

But this gives me a server error every forth time.  Any way of avoiding
this undesirable effect would be much appreciated.

Mike