aboutsummaryrefslogtreecommitdiff
path: root/perl/fcgi.pl
diff options
context:
space:
mode:
authorEmil Williams2025-08-21 01:01:39 +0000
committerEmil Williams2025-08-21 01:01:39 +0000
commitd72f41647a08d0940b2c69ca0ab9f975fd773b5b (patch)
tree910e88dc5101c6541c3d1404823d94133884c233 /perl/fcgi.pl
parent658f9c0c0fcce6a6371fbdaf8f74a5ca4265c9a9 (diff)
downloadgorillanest-d72f41647a08d0940b2c69ca0ab9f975fd773b5b.tar.xz
gorillanest-d72f41647a08d0940b2c69ca0ab9f975fd773b5b.tar.zst
Hide Everything, Hyde!
Diffstat (limited to 'perl/fcgi.pl')
-rwxr-xr-xperl/fcgi.pl23
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);
+}