www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: How should my libssh2 program detect when the data upload failed because the destination partition ran out of space?

Re: How should my libssh2 program detect when the data upload failed because the destination partition ran out of space?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 17 May 2014 10:08:59 +0200 (CEST)

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.

> 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.

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-17

the libssh2 team