';
$TagBegin{'p'} = '
';
$TagBegin{'pre'} = '
';
$TagBegin{'xmp'} = '';
$TagBegin{'caption'} = '';
$TagBegin{'th'} = '';
# Print message if elza.def is executed on its own
if ($DEF{'version'} eq '') { print "This file is not indended to be executed on its own.\n"}
elza-1.4.3.orig/elzafork.pl 0100644 0001750 0000144 00000003047 07031132650 014633 0 ustar stijn users #
# ELZAFORK fork for Win32.
#
# Usage
#
# perl elzafork.pl NUMBER COMMANDFILE
#
# This script will fork NUMBER instances of elza, each running COMMANDFILE
#
# To find out how to fork under Unix, see elza.txt
# Set those according to your setup
$PathToPerl = 'c:\perl\bin\perl.exe';
$PathToElza = 'c:\elza\elza.pl';
# This means all processes will share the same console.
$ElzaFlags = 'common';
# Uncomment this if you want processes running in background.
#$ElzaFlags = 'background';
# Uncomment this if you want each process to have its own console.
#$ElzaFlags = 'separate';
# ======================================================================
# NO CHANGES BELOW THIS LINE ARE NECESSARY
use Win32::Process;
print "FRK ELZAFORK forking $ARGV[0] instances of ELZA.\n";
for $Counter (1..$ARGV[0]) {
print "FRK Forking incarnation $Counter ... ";
if ($ElzaFlags eq 'common') {
Win32::Process::Create($FAKEOBJECT,$PathToPerl,"perl.exe $PathToElza $ARGV[1] $Counter $ARGV[0]",0, 0,'.') or die "FRK Unable to fork. Resource exhaustion?";
}
if ($ElzaFlags eq 'background') {
Win32::Process::Create($FAKEOBJECT,$PathToPerl,"perl.exe $PathToElza $ARGV[1]",0, DETACHED_PROCESS,'.') or die "FRK Unable to fork. Resource exhaustion?";
}
if ($ElzaFlags eq 'separate') {
Win32::Process::Create($FAKEOBJECT,$PathToPerl,"perl.exe $PathToElza $ARGV[1]",0, CREATE_NEW_CONSOLE ,'.') or die "FRK Unable to fork. Resource exhaustion?";
}
print "Forked: $FAKEOBJECT\n";
}
print "FRK Forking completed.\n"; elza-1.4.3.orig/elza.pl 0100644 0001750 0000144 00000120533 07032702762 013761 0 ustar stijn users #!c:\perl\bin\perl
# ========================================================================
# Hello! This is the source code for the ELZA interpreter.
# Make sure you edit elza.def before using this script.
# This script is placed in the public domain. Use as you see fit.
# The homepage of the project is http://phiphi.hypermart.net .
# The contact email is philip_stoev@iname.com. Feedback is always welcome.
# ========================================================================
use Socket;
$DEF{'version'} = '1.4.3'; # ELZA Version
# Read various default values from elza.def
$DEFAULTS = 'elza.def';
open DEFAULTS or shout ('critical', "Unable to open defaults file $DEFAULTS: $!");
foreach $Line () {eval $Line;}
close DEFAULTS;
if ($DefaultsReviewed != 1) {
shout ('critical', "Please review the defaults in $DEFAULTS before running the ELZA.");
}
# Initally, no successful requests
$VAR{'tot_req'} = 0; $SuccessfulRequests = 0;
$BytesSent = 0; $VAR{'tot_rcv'} = 0;
$VAR{'tot_ok'} = 0; $RedirRequests = 0;
$VAR{'tot_pass'} = 0;
$SocketOpened = 0;
# We will normally have 2nd and 3rc command line parameter if we are forked.
$VAR{'instance'} = $ARGV[1];
$VAR{'instances'} = $ARGV[2];
# Unbuffer STDOUT, otherwise Linux misbehaves on printraw statements.
$| = 1;
$LastPosition = 0;
# If we are called via GET / HEAD ...
if (($ENV{'REQUEST_METHOD'} ne '') && ($ENV{'REQUEST_METHOD'} ne 'POST')) {
print STDOUT "Content-type: text/plain\n\n";
print STDOUT "Please execute ELZA with POST.\n";
exit;
}
# If we are called via a POST ...
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
# Read the fields of the form
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
shout ('verbose' , "Received from POST request: $name \= $value .");
}
if ($FORM{'silent'} eq 'on') {
$VAR{'silent'} = $FORM{'silent'};
} else {
shout ('raw', 'Content-type: text/plain\n\n');
shout ('normal', "--- Hello. This is the ELZA interpreter version $DEF{'version'}.");
shout ('normal', "--- Running in remote mode. Called from $ENV{'REMOTE_ADDR'} .");
}
# The file to execute is within the 'elza-web-script' field
$SCRIPT = "<$FORM{'elza-web-script'}";
$| = 1;
} else {
# The file to execute is the first argument of the command line
shout ('info', "Hello. This is the ELZA interpreter version $DEF{'version'}.");
if ($VAR{'instance'} ne '') {
shout ('info', "I am instance $VAR{'instance'} of total $VAR{'instances'} instances.");
}
if ($ARGV[0] eq '') {
print STDOUT "??? Please enter script to execute: ";
$SCRIPT = ;
$SCRIPT =~ s/[\r\n]//g;
if ($SCRIPT eq '') {
shout ('critical',"No script name was entered.");
} else {
$SCRIPT = '<'.$SCRIPT;
}
} else {
$SCRIPT = '<'.$ARGV[0];
}
}
$startclock = time();
open SCRIPT or shout ('critical', "Unable to open script $SCRIPT: $!");
shout ('info',"Now processing commands from $SCRIPT");
$IsWebEnabled = 0;
$ProcName = '';
# Process the main command file, labels, procs, etc.
$LineNum = 0;
while ( |