1 # NOTE: Derived from blib/lib/Net/SSLeay.pm.
2 # Changes made here will be lost when autosplit is run again.
6 #line 1834 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/open_proxy_tcp_connection.al)"
7 ### Open connection via standard web proxy, if one was defined
10 sub open_proxy_tcp_connection {
11 my ($dest_serv, $port) = @_;
12 return open_tcp_connection($dest_serv, $port) if !$proxyhost;
14 warn "Connect via proxy: $proxyhost:$proxyport" if $trace>2;
15 my ($ret, $errs) = open_tcp_connection($proxyhost, $proxyport);
16 return wantarray ? (0, $errs) : 0 if !$ret; # Connection fail
18 warn "Asking proxy to connect to $dest_serv:$port" if $trace>2;
19 #print SSLCAT_S "CONNECT $dest_serv:$port HTTP/1.0$proxyauth$CRLF$CRLF";
20 #my $line = <SSLCAT_S>; # *** bug? Mixing stdio with syscall read?
22 tcp_write_all("CONNECT $dest_serv:$port HTTP/1.0$proxyauth$CRLF$CRLF");
23 return wantarray ? (0,$errs) : 0 if $errs;
24 ($line, $errs) = tcp_read_until($CRLF . $CRLF, 1024);
25 warn "Proxy response: $line" if $trace>2;
26 return wantarray ? (0,$errs) : 0 if $errs;
27 return wantarray ? (1,'') : 1; # Success
30 # end of Net::SSLeay::open_proxy_tcp_connection