freebsd-ports/ftp/mirror/files/patch-af
Torsten Blum 116a2abbae - Upgrade to 2.9
- Use perl5
1998-06-08 12:41:15 +00:00

58 lines
1.9 KiB
Text

*** lchat.pl.orig Fri May 29 21:05:46 1998
--- lchat.pl Mon Jun 8 14:34:37 1998
***************
*** 161,167 ****
# Similar to open_port, but does less. Used for PASV code with ftp.pl
# -Erez Zadok.
sub open_newport { ## public
! local($server, $port, $newsock) = @_;
local($serveraddr,$serverproc);
--- 161,167 ----
# Similar to open_port, but does less. Used for PASV code with ftp.pl
# -Erez Zadok.
sub open_newport { ## public
! local($server, $port, *newsock) = @_;
local($serveraddr,$serverproc);
***************
*** 180,197 ****
}
$serverproc = pack($sockaddr, 2, $port, $serveraddr);
! unless (connect($newsock, $serverproc)) {
! ($!) = ($!, close($newsock)); # close newsock while saving $!
return undef;
}
# We opened with the local address set to ANY, at this stage we know
# which interface we are using. This is critical if our machine is
# multi-homed, with IP forwarding off, so fix-up.
local($fam,$lport);
! ($fam,$lport,$thisaddr) = unpack($sockaddr, getsockname($newsock));
$thisproc = pack($sockaddr, 2, 0, $thisaddr);
# end of post-connect fixup
! select((select($newsock), $| = 1)[0]);
return 1;
}
##############################################################################
--- 180,197 ----
}
$serverproc = pack($sockaddr, 2, $port, $serveraddr);
! unless (connect(newsock, $serverproc)) {
! ($!) = ($!, close(newsock)); # close newsock while saving $!
return undef;
}
# We opened with the local address set to ANY, at this stage we know
# which interface we are using. This is critical if our machine is
# multi-homed, with IP forwarding off, so fix-up.
local($fam,$lport);
! ($fam,$lport,$thisaddr) = unpack($sockaddr, getsockname(newsock));
$thisproc = pack($sockaddr, 2, 0, $thisaddr);
# end of post-connect fixup
! select((select(newsock), $| = 1)[0]);
return 1;
}
##############################################################################