300 if presp[0] == "3" and self.__proxyAccount: |
300 if presp[0] == "3" and self.__proxyAccount: |
301 presp = self.sendcmd("ACCT " + self.__proxyAccount) |
301 presp = self.sendcmd("ACCT " + self.__proxyAccount) |
302 if presp[0] != "2": |
302 if presp[0] != "2": |
303 raise E5FtpProxyError( |
303 raise E5FtpProxyError( |
304 "9{0}0 Error authorizing at proxy\n{1}".format( |
304 "9{0}0 Error authorizing at proxy\n{1}".format( |
305 presp[0], presp)) |
305 presp[0], presp)) |
306 |
306 |
307 if self.__proxyType == E5FtpProxyType.Site: |
307 if self.__proxyType == E5FtpProxyType.Site: |
308 # send SITE command |
308 # send SITE command |
309 presp = self.sendcmd("SITE " + self.__host) |
309 presp = self.sendcmd("SITE " + self.__host) |
310 if presp[0] != "2": |
310 if presp[0] != "2": |
311 raise E5FtpProxyError( |
311 raise E5FtpProxyError( |
312 "9{0}0 Error sending SITE command\n{1}".format( |
312 "9{0}0 Error sending SITE command\n{1}".format( |
313 presp[0], presp)) |
313 presp[0], presp)) |
314 elif self.__proxyType == E5FtpProxyType.Open: |
314 elif self.__proxyType == E5FtpProxyType.Open: |
315 # send OPEN command |
315 # send OPEN command |
316 presp = self.sendcmd("OPEN " + self.__host) |
316 presp = self.sendcmd("OPEN " + self.__host) |
317 if presp[0] != "2": |
317 if presp[0] != "2": |
318 raise E5FtpProxyError( |
318 raise E5FtpProxyError( |
319 "9{0}0 Error sending OPEN command\n{1}".format( |
319 "9{0}0 Error sending OPEN command\n{1}".format( |
320 presp[0], presp)) |
320 presp[0], presp)) |
321 |
321 |
322 # authenticate to the remote host or combined to proxy and remote host |
322 # authenticate to the remote host or combined to proxy and remote host |
323 resp = self.sendcmd("USER " + user) |
323 resp = self.sendcmd("USER " + user) |
324 if resp[0] == "3": |
324 if resp[0] == "3": |
325 resp = self.sendcmd("PASS " + password) |
325 resp = self.sendcmd("PASS " + password) |