#!/usr/bin/perl -W
use strict;
use warnings;
use IO::Handle;
STDOUT -> autoflush (1); # sicherheitshalber statt $| = 1;
use Digest::MD5 qw (md5_hex);
use CGI qw (:push);
my $q = CGI -> new;
(my $script = $0) =~ s/^.*[\\\/]//g;
if (defined $q -> param ('action') && defined $q -> param ('sekunden')) {
my $header = $q -> header;
if ($q -> param ('action') eq 'start1') {
sleep $q -> param ('sekunden');
}
elsif ($q -> param ('action') eq 'start3') {
CGI -> nph (1); # no-parsed-header Modus (Header wird vom Script gesendet)
print multipart_init (-boundary => '----here we go!');
sleep $q -> param ('sekunden');
# $header = "Status: 100 Continue\n$header";
# funktioniert (noch) nicht
}
elsif ($q -> param ('action') eq 'start4') {
if (defined $q -> param ('warte') && $q -> param ('warte') ne '') {
if (-f $q -> param ('warte')) {
print $header . 'fertig';
exit ();
}
else {
print $header . 'hold';
exit ();
}
}
else {
my $datei = md5_hex ($ENV{'REMOTE_ADDR'},$ENV{'REMOTE_PORT'},time,ZUFALL(),$$);
if (my $pid = fork ()) {
# Vater
print <