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