Git Product home page Git Product logo

Comments (4)

sbredahl avatar sbredahl commented on July 22, 2024

I can confirm that some weird things happen if the buffer maxlen is much larger than 4k (7k works for me also, but 8k is too large). I end up in an infinite loop where libssh2_sftp_read() keeps returning 0 (in blocking mode).

I don't get any access violation however (also Win7 x64).

from libssh2.

sbredahl avatar sbredahl commented on July 22, 2024

I have investigated this issue a little further (using example-sftp) on both of my libssh2 builds (Ubuntu 14.10 and Windows 7) at work.

Corrupted downloads happen (in both builds) if buffer_maxlen * 4 > MAX_SFTP_READ_SIZE. So with the current MAX_SFTP_READ_SIZE=30000, problems occur if buffer_maxlen>7500.

Edit: It is actually the "max_read_ahead" value in sftp.c that causes the issue. It is set to 4*buffer_size but if it exceeds MAX_SFTP_READ_SIZE things break.

As a workaround we could use max_read_ahead = MIN(MAX_SFTP_READ_SIZE, 4*buffer_size) until someone figures out the right solution here...

from libssh2.

jakob avatar jakob commented on July 22, 2024

@Corillian Could you check if my branch https://github.com/jakob/libssh2/tree/sftp-read-fix (see pull request #75) fixes your issues?

from libssh2.

bagder avatar bagder commented on July 22, 2024

That fix is now merged into master and we believe this bug is fixed. Please provide details if not.

from libssh2.

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.