diff options
| author | Emil Williams | 2025-08-21 01:01:39 +0000 |
|---|---|---|
| committer | Emil Williams | 2025-08-21 01:01:39 +0000 |
| commit | d72f41647a08d0940b2c69ca0ab9f975fd773b5b (patch) | |
| tree | 910e88dc5101c6541c3d1404823d94133884c233 /perl/fcgi.pl | |
| parent | 658f9c0c0fcce6a6371fbdaf8f74a5ca4265c9a9 (diff) | |
| download | gorillanest-d72f41647a08d0940b2c69ca0ab9f975fd773b5b.tar.xz gorillanest-d72f41647a08d0940b2c69ca0ab9f975fd773b5b.tar.zst | |
Hide Everything, Hyde!
Diffstat (limited to 'perl/fcgi.pl')
| -rwxr-xr-x | perl/fcgi.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/perl/fcgi.pl b/perl/fcgi.pl new file mode 100755 index 0000000..0f3dff8 --- /dev/null +++ b/perl/fcgi.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Syntax::Keyword::Try; +use FCGI; + +use lib qw(perl); +BEGIN { require 'cgi.pl'; } + +while (1) { + try { + open STDERR, '>', LOG_FILE or die LOG_FILE . ": $!"; + my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, BARE_REQUEST ? 0 : FCGI::OpenSocket(SOCKET_FILE, SOCKET_MAX_CONNECTIONS)); + while($request->Accept() >= 0) { + master(); + } + } catch ($error) { + info("Crashed: $error"); + } + exit 1 unless (IMMORTAL); +} |
