Subject: Re: [libssh2] Patch to report the remote error message when using scp

Re: [libssh2] Patch to report the remote error message when using scp

From: James Housley <jim_at_thehousleys.net>
Date: Wed, 4 Jul 2007 11:14:08 -0400

On Jul 4, 2007, at 10:08 AM, Gavrie Philipson wrote:

> Hi,
>
> I'm using libssh2 (incidentally, together with curl) to upload a file
> to a remote host using the SCP protocol
> Now, if the remote side returns an error message such as "Permission
> denied" or "No such file or directory", it is not reported by libssh2.
> Instead, the generic message "Invalid ACK response from remote" is
> reported.
>
> The attached patch reads the remote error message, and reports it in a
> way similar to the command-line scp(1) command.
>
> To see its effect, when using curl normally, this is what happens on a
> "Permission denied" error:
>
> Without the patch:

That patch breaks the code. Since you are calling
libssh2_channel_read_ex() in one point you have to create a new state
so that when PACKET_EAGAIN is returned the code can return to the
exact same location and only do the libssh2_channel_read_ex() read
call with the exact same data. BUT, the concept is good and a step
in the right direction. Let me take a look and see if I can fix the
patch.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
                      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
Progress (n) : What led from smart users in front of dumb terminals to
dumb users in front of smart terminals.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-07-04