> -----Original Message-----
> From: libssh2-devel-bounces_at_cool.haxx.se
> [mailto:libssh2-devel-bounces_at_cool.haxx.se] On Behalf Of Phillip Wu
> Sent: Thursday, May 06, 2010 1:22 PM
> To: libssh2-devel_at_cool.haxx.se
> Subject: sftp error - LIBSSH2_ERROR_SFTP_PROTOCOL
>
> Two questions please:
> 1) Is it true to say that LIBSSH2_ERROR_SFTP_PROTOCOL is not
> really an error as such and I should always call
> libssh2_sftp_last_error when ever I get LIBSSH2_ERROR_SFTP_PROTOCOL ?
Let's take a look at the code of libcurl:
================================================
/* from curl-7.20.1/lib/ssh.c */
if(LIBSSH2_ERROR_SFTP_PROTOCOL == rc)
/* only when there was an SFTP protocol error can we extract
the sftp error! */
err = (int)(libssh2_sftp_last_error(sshc->sftp_session));
else
err = -1; /* not an sftp error at all */
================================================
My understanding is that LIBSSH2_ERROR_SFTP_PROTOCOL shows the return code is kind of related to SFTP protocol. Only under this case, you can go on to decide what specific SFTP error it is by calling libssh2_sftp_last_error().
> 2) Where can I get a table of the codes returned by
> libssh2_sftp_last_error and their meanings?
You can get the whole set of error numbers in "libssh2-1.2.5/include/libssh2.h", from LIBSSH2_ERROR_NONE (0) to LIBSSH2_ERROR_AGENT_PROTOCOL (-42).
Regards,
Xu Qiang
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-05-06