Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. import pysftp
  2. upftp=FTP(host=ftp_ip, user=ftp_name, passwd=ftp_passwd, acct=ftp_port, timeout=None)
  3. ...
  4.  
  5. try:
  6. upftp.storbinary('STOR %s'%obj[2], fp, 8192, self.callpecent)
  7. except Exception as error:
  8. fp.close()
  9. self.endit(upftp, 1, '%s,%s'%(obj[2],error), '%s,%s'%(obj[2],error)
  10.  
  11. 2015-03-24 09:43:05 DEBUG - Rekeying (hit 32729 packets, 536900100 bytes sent)
  12.  
  13. 2015-03-24 09:43:05 DEBUG - Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
  14. 2015-03-24 09:43:05 DEBUG - using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
  15. 2015-03-24 09:43:05 ERROR - Exception: Expecting packet from (31,), got 94
  16. 2015-03-24 09:43:05 ERROR - Traceback (most recent call last):
  17. 2015-03-24 09:43:05 ERROR - File "D:Python34libsite-packagesparamiko-1.14.0-py3.4.eggparamikotransport.py", line 1435, in run
  18. 2015-03-24 09:43:05 ERROR - raise SSHException('Expecting packet from %r, got %d' % (self._expected_packet, ptype))
  19. 2015-03-24 09:43:05 ERROR - paramiko.ssh_exception.SSHException: Expecting packet from (31,), got 94
  20. 2015-03-24 09:43:05 ERROR -
  21. 2015-03-24 09:43:05 DEBUG - Dropping user packet because connection is dead.
  22. 2015-03-24 09:43:05 DEBUG - [chan 1] close(b'd40b000000000000')
  23. 2015-03-24 09:43:05 INFO - [chan 1] sftp session closed.
  24.  
  25. self.ssh_client.connect(...)
  26. transport = self.ssh_client.get_transport()
  27. transport.default_window_size = 2147483647
  28. transport.packetizer.REKEY_BYTES = pow(2, 40)
  29. transport.packetizer.REKEY_PACKETS = pow(2, 40)
  30. self.sftp_client = self.ssh_client.open_sftp()
  31.  
  32. print(self.sft_client.get_channel().in_window_size)
  33. print(sftp_connection.get_channel().in_max_packet_size)
  34.  
  35. # Output
  36.  
  37. 2147483647
  38. 32768
  39.  
  40. in the paramiko/packet.py
  41.  
  42. REKEY_PACKETS = pow(2, 29)
  43. REKEY_BYTES = pow(2, 29)
  44.  
  45. REKEY_PACKETS_OVERFLOW_MAX = pow(2, 29) # Allow receiving this many packets after a re-key request before terminating
  46. REKEY_BYTES_OVERFLOW_MAX = pow(2, 29) # Allow receiving this many bytes after a re-key request before terminating
  47.  
  48. def _trigger_rekey(self):
  49. # outside code should check for this flag
  50. self.__need_rekey = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement