Perhaps you can try to read the stderr channel to get the error message itself.(I had a few similar cases where that really helped in diagnosing problems). That doesn't help as much as an error code, but it is a start.
Bert
-----Original Message-----
From: "Jeremy Friesner" <jfriesne_at_gmail.com>
Sent: 17-5-2014 17:18
To: "libssh2 development" <libssh2-devel_at_cool.haxx.se>
Subject: Re: How should my libssh2 program detect when the data upload failedbecause the destination partition ran out of space?
On May 17, 2014, at 1:08 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 16 May 2014, Jeremy Friesner wrote:
>
>> The problem I ran into today involves the scenario when there isn't enough drive-space free on the remote machine to hold the entire 152MB file. What I would expect to have happen in this case is for libssh2_channel_write() to return an error-code at some point to indicate the failure, but the behavior I observe instead is that libssh2_channel_write() keeps on behaving normally (i.e. returning positive values or -1/LIBSSH2_ERROR_EGAIN, since I'm using non-blocking I/O), as if the file transfer was working fine.
>
> I would expect that to happen as well. Your server obviously doesn't return any error for this...
>
>> I note that scp did detect the error, but not until *after* it had already uploaded all 152MB to the server.
>
> Which sounds like a sympthom of the same thing.
Yes, I expect it is — OTOH, the scp client was able to print the appropriate error message, so it must be doing something that my program doesn’t do, in order to do that.
>> Otherwise, where are all those bytes of data being placed during the upload?
>
> That would be a question to whoever did the server you're talking to that eats the bytes.
The server is the sshd that ships with Debian Linux; I’m not very clear about who to contact about that…
Jeremy
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-17