Hi lists, Reading example's source code, I see duplicate calls of libssh2_session_set_blocking() function in the following files :
simple/sftp.c simple/sftp_write.c simple/sftp_write_nonblock.c So, I attached a unified diff to clean them. Regards -- Sofian Brabez - s...@wallix.com Pôle Produits / Security Research and Development http://www.wallix.com WALLIX, 118 Rue de Tocqueville 75017 Paris
diff -urN simple.old/sftp.c simple/sftp.c --- simple.old/sftp.c 2009-03-27 15:48:07.000000000 +0100 +++ simple/sftp.c 2009-03-27 15:56:28.000000000 +0100 @@ -131,9 +131,6 @@ return -1; } - /* Since we have not set non-blocking, tell libssh2 we are blocking */ - libssh2_session_set_blocking(session, 1); - /* At this point we havn't yet authenticated. The first thing to do * is check the hostkey's fingerprint against our known hosts Your app * may have it hard coded, may go to a file, may present it to the @@ -207,9 +204,6 @@ goto shutdown; } - /* Since we have not set non-blocking, tell libssh2 we are blocking */ - libssh2_session_set_blocking(session, 1); - fprintf(stderr, "libssh2_sftp_open()!\n"); /* Request a file via SFTP */ sftp_handle = diff -urN simple.old/sftp_write.c simple/sftp_write.c --- simple.old/sftp_write.c 2009-03-27 15:48:07.000000000 +0100 +++ simple/sftp_write.c 2009-03-27 15:58:11.000000000 +0100 @@ -155,9 +155,6 @@ goto shutdown; } - /* Since we have not set non-blocking, tell libssh2 we are blocking */ - libssh2_session_set_blocking(session, 1); - fprintf(stderr, "libssh2_sftp_open()!\n"); /* Request a file via SFTP */ sftp_handle = diff -urN simple.old/sftp_write_nonblock.c simple/sftp_write_nonblock.c --- simple.old/sftp_write_nonblock.c 2009-03-27 15:48:07.000000000 +0100 +++ simple/sftp_write_nonblock.c 2009-03-27 15:58:30.000000000 +0100 @@ -180,9 +180,6 @@ } } while (!sftp_session); - /* Since we have set non-blocking, tell libssh2 we are non-blocking */ - libssh2_session_set_blocking(session, 0); - fprintf(stderr, "libssh2_sftp_open()!\n"); /* Request a file via SFTP */ do {
------------------------------------------------------------------------------
_______________________________________________ libssh2-devel mailing list libssh2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libssh2-devel