Skip to content

Instable connections in case of SSH transfers over nonblocking sockets #1397

@klux21

Description

@klux21

I faced instable TCP connections that are tunneled over SSH in case of transferring huge buffers using libssh2 1.10.0.
I'm using libssh2 for SSH connections together with libressl and nonblocking sockets with possibly slow connections in usually single threaded applications. The problem was the usage of storage on the stack and relying on that data and it's address on the stack in subsequent calls once sending fails with EAGAIN or EWOULDBLOCK.
I did create a patch for version 1.10.0 and did see, that you have been working on a similar issue in 1.11.0 without resolving the reason of the problem. You'll find my patches of the sources in the attachment. I didn't yet verify the patch for version 1.11.0 and can't provide any test case. But it's just some few lines and not hard to understand. May be some of the maintainer of the library is able to have a look on the patches and to add those or better ones to the sources? Thanks in advance and for that library of course as well!

I have attached my patches and copies of the original files for version 1.10.0 and 1.11.0. I'm not insisting on any copyright of those little changes so everybody is free to use and modify that code according the copyright conditions of libssh2.
libssh2-patches.tgz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions