Coder Social home page Coder Social logo

Comments (4)

ppayne avatar ppayne commented on May 30, 2024

I have tested against the history of SFTPv3.js and can confirm commit 2081bff was WORKING, and commit 538e9e7 FAILED.

from ssh2.

brandonramirez avatar brandonramirez commented on May 30, 2024

I am seeing this behavior as well. Uploading a tarball results in a destination file exactly double the size of the source. Needless to say, untar does not like the file.

from ssh2.

brandonramirez avatar brandonramirez commented on May 30, 2024

As @ppayne indicated, commit 538e9e7 is definitely the root cause. I have found the bug.

In WriteStream.prototype.write, line 1753, this.pos is incremented by the size of the latest buffer chunk. Then it calls this.flush(). In commit 538e97, flush was changed to also increment this.pos by the data length when sftp.write is the method being used. Therefore, there is a double-increment, causing the file to be exactly double.

Removing line 1700 from SFTPv3.js resolves this problem.

I can supply a patch.

from ssh2.

mscdex avatar mscdex commented on May 30, 2024

Also: I'm currently in the process of switching over all streams1 code to streams2, which should simplify/fix a lot.

from ssh2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.