MCPcopy Index your code
hub / github.com/python/cpython / makepasv

Method makepasv

Lib/ftplib.py:324–334  ·  view source on GitHub ↗

Internal: Does the PASV or EPSV handshake -> (address, port)

(self)

Source from the content-addressed store, hash-verified

322 return sock
323
324 def makepasv(self):
325 """Internal: Does the PASV or EPSV handshake -> (address, port)"""
326 if self.af == socket.AF_INET:
327 untrusted_host, port = parse227(self.sendcmd('PASV'))
328 if self.trust_server_pasv_ipv4_address:
329 host = untrusted_host
330 else:
331 host = self.sock.getpeername()[0]
332 else:
333 host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
334 return host, port
335
336 def ntransfercmd(self, cmd, rest=None):
337 """Initiate a transfer over the data connection.

Calls 4

sendcmdMethod · 0.95
parse227Function · 0.85
parse229Function · 0.85
getpeernameMethod · 0.45