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

Method cmd_pasv

Lib/test/test_ftplib.py:162–170  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

160 self.push('200 active data connection established')
161
162 def cmd_pasv(self, arg):
163 with socket.create_server((self.socket.getsockname()[0], 0)) as sock:
164 sock.settimeout(TIMEOUT)
165 port = sock.getsockname()[1]
166 ip = self.fake_pasv_server_ip
167 ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256
168 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))
169 conn, addr = sock.accept()
170 self.dtp = self.dtp_handler(conn, baseclass=self)
171
172 def cmd_eprt(self, arg):
173 af, ip, port = arg.split(arg[0])[1:-1]

Callers

nothing calls this directly

Calls 6

pushMethod · 0.95
create_serverMethod · 0.45
getsocknameMethod · 0.45
settimeoutMethod · 0.45
replaceMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected