print "Generating FCGI.pm\n";
print OUT <<'EOP';
-# $Id: FCGI.PL,v 1.29 2001/09/20 11:07:36 skimo Exp $
+# $Id: FCGI.PL,v 1.30 2001/09/20 12:00:23 skimo Exp $
package FCGI;
env => shift,
socket => shift,
flags => shift,
+ last => 0,
};
open $self->{listen_sock}, "<&=0";
bless $self, "FCGI";
}
$req->Finish();
$req->{socket} = gensym();
- if (!accept($req->{socket}, $req->{listen_sock})) {
+ if ($req->{last} || !accept($req->{socket}, $req->{listen_sock})) {
$req->{error} = "accept";
return -1;
}
$req->{accepted} = 0;
}
+sub LastCall {
+ shift->{last} = 1;
+}
+
sub DESTROY {
shift->Finish();
}
Re-attaches filehandles on an accepted connection.
+=item $req->LastCall()
+
+Tells the library not to accept any more requests on this handle.
+It should be safe to call this method from signal handlers.
+
+Note that this method is still experimental and everything
+about it, including its name, is subject to change.
+
=item $env = $req->GetEnvironment()
Returns the environment parameter passed to FCGI::Request.
print OUT while <DATA>;
close OUT;
__END__
-/* $Id: FCGI.XL,v 1.5 2001/09/20 11:03:41 skimo Exp $ */
+/* $Id: FCGI.XL,v 1.6 2001/09/20 12:00:24 skimo Exp $ */
#include "EXTERN.h"
#include "perl.h"
void
Detach(request)
-
FCGI request;
PROTOTYPE: $
void
Attach(request)
-
FCGI request;
PROTOTYPE: $
if (request->accepted && !request->bound)
FCGI_Bind(request);
+void
+LastCall(request)
+ FCGI request;
+
+ PROTOTYPE: $
+
+ CODE:
+ FCGX_ShutdownPending();
int
FCGI_StartFilterData(request)