Leser: 1
|< 1 2 >| | 19 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# Request/Response-Zyklus mit umrahmendem Timeout und erster
# Auswertung:
sub tu_https
{
my ($site, $port, $req, $timeout ) = @_;
my ($response, $headers, $page, $errs, $http);
# HTTP - Rohdaten:
$timeout = 6 if ! defined $timeout;
# eigentliche Anfrage - geschutzt durch ALARM
eval
{
local $SIG{ALRM} = sub { warn "sslcat $site:$port timeout"; $errs = 1; };
alarm($timeout);
# $http: enthalt die komplette Antwort. Zeilen enden in CRLF
# $errs: enthalt Fehlermeldung; Leerstring fur: OK.
($http, $errs) = sslcat($site, $port, $req);
alarm(0);
};
#
# falls eval schief ging:
if ( $@ )
{ $errs = "$0: $$: sslcat failed. $@ $timeout Secs.\n";
print STDERR "EVAL FEHLER '$@' $timeout Secs !!!!\n";
}
# print STDERR "******** Zurueck! :\nHTTP='$http'\nERRS='$errs'\n";
#
# den Fehlerfall fuhren wir auf eine Response zuruck:
#
if ( $errs )
{ $http = "HTTP/1.0 900 NET OR SSL ERROR\r\n\r\n$errs";
}
elsif ( "$http" eq "" ) # xyundef warum ? noch analysieren
{ $http = "HTTP/1.0 901 EMPTY ANSWER\r\n\r\nHTTP='$http'\r\n";
}
elsif ( $http !~ /^http/i ) # xyundef warum ? noch analysieren
{ $http = "HTTP/1.0 902 SCHROTT ANSWER\r\n\r\nHTTP='$http'\r\n";
print STDERR "MUELLMUELL: '$http'\n";
}
return ( $http );
}
local $SIG{ALRM} = sub { warn "sslcat $site:$port timeout"; $errs = 1; };
1
2
3
Why doesn't signal handling work on Windows?
Signals are unsupported by the Win32 API. The C Runtime provides crude support for signals, but there are serious caveats, such as inability to die() or exit() from a signal handler. Perl itself does not guarantee that signal handlers will not interrupt critical operations such as memory allocation, which means signal invocation may throw perl internals into disarray. For these reasons, signals are unsupported at this time.
|< 1 2 >| | 19 Einträge, 2 Seiten |