mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
FTP.ntransfercmd method now uses create_connection when passive,
using the timeout received in connection time.
This commit is contained in:
parent
50b79ce8e6
commit
9249312020
2 changed files with 5 additions and 3 deletions
|
@ -319,9 +319,7 @@ class FTP:
|
|||
size = None
|
||||
if self.passiveserver:
|
||||
host, port = self.makepasv()
|
||||
af, socktype, proto, canon, sa = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0]
|
||||
conn = socket.socket(af, socktype, proto)
|
||||
conn.connect(sa)
|
||||
conn = socket.create_connection((host, port), self.timeout)
|
||||
if rest is not None:
|
||||
self.sendcmd("REST %s" % rest)
|
||||
resp = self.sendcmd(cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue