Subject: write returns zero

write returns zero

From: San <sganis_at_gmail.com>
Date: Fri, 27 Mar 2020 23:37:36 +0300

Hello All,

What are the possible reasons of *libssh2_sftp_write* returning zero ?
My implementation follows this example. I have to check for rc<=0 or there
is an endless loop because the write function returns 0 all the time.
What's happening?

        *do* {
            */* write data in a loop until we block */ *
            *while*((rc = libssh2_sftp_write
<https://www.libssh2.org//libssh2_sftp_write.html>(sftp_handle, ptr,
nread)) ==

                   LIBSSH2_ERROR_EAGAIN) {
                waitsocket(sock, session);
            }
            *if*(rc < 0)
                *break*;
            ptr += rc;
            nread -= rc;

        } *while*(nread);

// San.

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2020-03-27