-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pseudo-io writes fail for >= 256kB writes #99
Comments
|
@RootTJNII actually I got problem with |
Issue solved, connection was in class method, which was cached, moved the connection to instance method. |
I found the workaround as mentioned here |
Ran into the same issue today. Using It doesn't seem like there is any logic for checking the size of the payload within the packet to be delivered to the server when using the I really wanted to avoid writing anything to disk and using string_io = StringIO.new(file_data)
Net::SFTP.start(*args) do |sftp|
file_handle = sftp.open!("foo.bin", "wb+")
# utilizes the configured max packet size, by default it's 32768 bytes
max_packet_size = sftp.channel.local_maximum_packet_size
offset = 0
until string_io.eof?
datum = string_io.read(max_packet_size)
sftp.write!(file_handle, offset, datum)
offset += datum.bytesize
end
end |
@acuster77 Your solution worked in my case. Thanks for this. |
When attempting to write >= 256kB of data I'm consistently seeing the connection hang. For the following code:
I see the following output:
The exception appears to be the same as #94.
The text was updated successfully, but these errors were encountered: