cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: giva: curl/lib ssh.c,1.43,1.44

From: James Housley <jim_at_thehousleys.net>
Date: Wed, 13 Jun 2007 10:11:24 -0400

On Jun 13, 2007, at 10:01 AM, cvs_at_labb.contactor.se wrote:

> Update of /cvsroot/curl/curl/lib
> In directory labb:/tmp/cvs-serv28517
>
> Modified Files:
> ssh.c
> Log Message:
> libssh2_session_free() returns void. Fix "#endif".
>
> Index: ssh.c
> ===================================================================
> RCS file: /cvsroot/curl/curl/lib/ssh.c,v
> retrieving revision 1.43
> retrieving revision 1.44
> diff -u -d -r1.43 -r1.44
> --- ssh.c 13 Jun 2007 12:15:23 -0000 1.43
> +++ ssh.c 13 Jun 2007 14:01:48 -0000 1.44
> @@ -468,7 +468,7 @@
> state(conn, SSH_AUTH_KEY);
> } else {
> state(conn, SSH_AUTH_DONE);
> - }
> + }
> break;
>
> case SSH_AUTH_KEY:
> @@ -651,10 +651,7 @@
> break;
>
> case SSH_SESSION_FREE:
> - rc = libssh2_session_free(ssh->ssh_session);
> - if (rc == LIBSSH2_ERROR_EAGAIN) {
> - break;
> - }
> + libssh2_session_free(ssh->ssh_session);
> ssh->ssh_session = NULL;
> state(conn, SSH_STOP);
> result = sshc->actualCode;
> @@ -753,7 +750,7 @@
>
> return result;
> }
> -#endif (LIBSSH2_APINO >= 200706012030)
> +#endif /* (LIBSSH2_APINO >= 200706012030) */
>
> /*
> * SSH setup and connection
>
> _______________________________________________
> curl-commits mailing list
> curl-commits_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-commits

1) libssh2_session_free() is not a "void", it is an "int", check the
latest sources from yesterday.
Revision 1.46 - (view) (download) (annotate) - [select for diffs]
Tue Jun 12 18:27:50 2007 UTC (19 hours, 42 minutes ago) by jehousley
Branch: MAIN
CVS Tags: HEAD
Changes since 1.45: +40 -17 lines
Diff to previous 1.45
libssh2_channel_free() actually can return PACKET_EAGAIN. Update all
calling functions to support that with the following API notes:

* libssh2_publickey_shutdown(), libssh2_session_free() changed
   to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN.

* libssh2_scp_recv(), libssh2_scp_send_ex() and libssh2_sftp_init()
   will loop in on libssh2_channel_free() when there is an error.
   It is not possible to return LIBSSH2_ERROR_EAGAIN in this condition
   in these 3 functions and not lose the original error code.

2) Version of GNU C that I use complain that you can't have anything
after "#endif", that is why it is in a comment

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
The wise man built his network upon Un*x.
     The foolish man built his network upon Windows.
Received on 2007-06-13