mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
secureserver.pl: added full support for tstunnel on Windows
tstunnel on Windows does not support the pid option and is unable to write to an output log that is already being used as a redirection target for stdout. Therefore it does now output all log data to stdout by default and secureserver.pl creates a fake pidfile on Windows.
This commit is contained in:
parent
a33e7edcec
commit
87ade5f0eb
@ -251,16 +251,18 @@ if($stunnel_version >= 400) {
|
|||||||
print STUNCONF "
|
print STUNCONF "
|
||||||
CApath = $path
|
CApath = $path
|
||||||
cert = $certfile
|
cert = $certfile
|
||||||
pid = $pidfile
|
|
||||||
debug = $loglevel
|
debug = $loglevel
|
||||||
output = $logfile
|
output = /dev/stdout
|
||||||
socket = $socketopt
|
socket = $socketopt";
|
||||||
foreground = yes
|
if($stunnel !~ /tstunnel(\.exe)?"?$/) {
|
||||||
|
print STUNCONF "
|
||||||
|
pid = $pidfile
|
||||||
|
foreground = yes";
|
||||||
|
}
|
||||||
|
print STUNCONF "
|
||||||
[curltest]
|
[curltest]
|
||||||
accept = $accept_port
|
accept = $accept_port
|
||||||
connect = $target_port
|
connect = $target_port";
|
||||||
";
|
|
||||||
if(!close(STUNCONF)) {
|
if(!close(STUNCONF)) {
|
||||||
print "$ssltext Error closing file $conffile\n";
|
print "$ssltext Error closing file $conffile\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
@ -292,6 +294,25 @@ if($stunnel_version >= 400) {
|
|||||||
#
|
#
|
||||||
chmod(0600, $certfile) if(-f $certfile);
|
chmod(0600, $certfile) if(-f $certfile);
|
||||||
|
|
||||||
|
#***************************************************************************
|
||||||
|
# Run tstunnel on Windows.
|
||||||
|
#
|
||||||
|
if($stunnel =~ /tstunnel(\.exe)?"?$/) {
|
||||||
|
# Fake pidfile for tstunnel on Windows.
|
||||||
|
if(open(OUT, ">$pidfile")) {
|
||||||
|
print OUT $$ . "\n";
|
||||||
|
close(OUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Put an "exec" in front of the command so that the child process
|
||||||
|
# keeps this child's process ID.
|
||||||
|
exec("exec $cmd") || die "Can't exec() $cmd: $!";
|
||||||
|
|
||||||
|
# exec() should never return back here to this process. We protect
|
||||||
|
# ourselves by calling die() just in case something goes really bad.
|
||||||
|
die "error: exec() has returned";
|
||||||
|
}
|
||||||
|
|
||||||
#***************************************************************************
|
#***************************************************************************
|
||||||
# Run stunnel.
|
# Run stunnel.
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user