Skip to content

Commit

Permalink
Update dependency. Fix length field for SSH_FXP_WRITE packets https:/…
Browse files Browse the repository at this point in the history
…/github.com/dkocher/sshj/commit/68a054529b7d836a903a1c55aaf241b70e958c50. Fix #8603. Add test.

Former-commit-id: b7177262aafa4bd0e11fd64d78bdd36bd8205f20
  • Loading branch information
dkocher committed Feb 23, 2015
1 parent 77c079e commit 10cb693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified lib/sshj-0.11.0.jar
Binary file not shown.
7 changes: 5 additions & 2 deletions test/ch/cyberduck/core/sftp/SFTPWriteFeatureTest.java
Expand Up @@ -15,7 +15,9 @@
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathCache;
import ch.cyberduck.core.exception.NotfoundException;
import ch.cyberduck.core.io.BandwidthThrottle;
import ch.cyberduck.core.io.StreamCopier;
import ch.cyberduck.core.io.ThrottledOutputStream;
import ch.cyberduck.core.shared.DefaultHomeFinderService;
import ch.cyberduck.core.transfer.TransferStatus;

Expand All @@ -40,7 +42,7 @@
public class SFTPWriteFeatureTest extends AbstractTestCase {

@Test
public void testWrite() throws Exception {
public void testWriteThrottled() throws Exception {
final Host host = new Host(new SFTPProtocol(), "test.cyberduck.ch", new Credentials(
properties.getProperty("sftp.user"), properties.getProperty("sftp.password")
));
Expand All @@ -52,7 +54,8 @@ public void testWrite() throws Exception {
new Random().nextBytes(content);
status.setLength(content.length);
final Path test = new Path(session.workdir(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
final OutputStream out = new SFTPWriteFeature(session).write(test, status);
final OutputStream out = new ThrottledOutputStream(new SFTPWriteFeature(session).write(test, status),
new BandwidthThrottle(102400f));
assertNotNull(out);
new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
out.close();
Expand Down

0 comments on commit 10cb693

Please sign in to comment.