Skip to content

Reading data returns only empty buffer #1162

Closed
@jeffrson

Description

@jeffrson

Although I'm using ssh-promise as a wrapper, this issue is not related as far as I can tell.

I'm connecting to a server that's written using SSH2 as well. When I try to read some file (3289 Bytes) I can see the server filling buffers, but in the client they are returned empty.

I followed until https://github.com/mscdex/ssh2/blob/master/lib/protocol/SFTP.js#L2013, where req.nb is 0, so bufferSlice creates an empty buffer for data.

The file I try to read is 3289 Bytes, my buffer is 32kB, so req.nb is initialized with 0 and never changed.
nb is the correct size of the file, len is the size of the buffer (32kB). overflow is 816 (what does it mean?). data (incoming in cb) does contain the correct file contents.

So what might be wrong here? Why is data (outgoing) empty?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions