Subject: AW: libssh2_sftp_init ... I don't get it.

AW: libssh2_sftp_init ... I don't get it.

From: may nothing <may_241913_at_yahoo.com>
Date: Tue, 12 Oct 2010 07:52:19 +0100 (BST)

How ?

Either libssh2_session_last_errno and libssh2_trace getting completely ignored
and return nothing.
I compiled libssh2 with enable-debug and tested the whole thing on my local
machine which is runnig openssh-5.2p1-9.1.i586 ...
 

    fprintf(stderr, "libssh2_sftp_init()!\n");

    sftp_session = libssh2_sftp_init(session);

    if (!sftp_session)
    {
        fprintf(stderr, "Unable to init SFTP session\n");
        int errLast = libssh2_session_last_errno(sftp_session);
        printf("error is: ",errLast);
        libssh2_trace(session, 0);

        goto shutdown;
    }

Any help would be highly appreciated

cu
May

----- Ursprüngliche Mail ----
Von: Daniel Stenberg <daniel_at_haxx.se>
An: libssh2 development <libssh2-devel_at_cool.haxx.se>
Gesendet: Montag, den 11. Oktober 2010, 19:39:57 Uhr
Betreff: Re: libssh2_sftp_init ... I don't get it.

On Mon, 11 Oct 2010, may nothing wrote:

> I'm trying to get this code to run but libssh2_sftp_init always fails, and I
>don't have the any idea why. Could you help me

First, a minor clue could be extracted by checking the error code that was
stored when it returns NULL.

The even better way is to use libssh2_trace() on a debug-enabled libssh2 and
check all the gory details.

Are you sure your target SSH server even supports/allows SFTP?

-- 
/ daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-10-12