aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 83ceaff405..3eec86ae99 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -377,15 +377,9 @@ module Net
end
private :sendport
- # Constructs a TCPServer socket, and sends it the PORT command
- #
- # Returns the constructed TCPServer socket
+ # Constructs a TCPServer socket
def makeport # :nodoc:
- sock = TCPServer.open(@sock.addr[3], 0)
- port = sock.addr[1]
- host = sock.addr[3]
- sendport(host, port)
- return sock
+ TCPServer.open(@sock.addr[3], 0)
end
private :makeport
@@ -421,6 +415,7 @@ module Net
else
sock = makeport
begin
+ sendport(sock.addr[3], sock.addr[1])
if @resume and rest_offset
resp = sendcmd("REST " + rest_offset.to_s)
if resp[0] != ?3