[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a session with a pre-connected socket in 0.5.2


Hi,

You are right. We changed the socket handling internals a lot in 0.5 and
adding a pre-connected socket does not set libssh in the good states.
I'll check out today, I think this should be a one-liner.

Aris
Le 25/08/12 04:09, Mark Riordan a écrit :
> Hello.  
> I have an application that works with libssh 0.4.8, and I'm finally
> upgrading to libssh 0.5.2.
> It seems that the ability to use a pre-connected socket does not work in
> libssh 0.5.2. 
> 
> I use libssh's capability to pass a pre-connected socket, like so:
>   ssh_options_set(session, SSH_OPTIONS_FD, &sock);
>   ssh_connect(session);
> (The reason for this is that some users need to connect via a proxy, so my
> application first connects to the proxy and authenticates to it, and then
> hands the socket to libssh.)
> 
> This works fine with 0.4.8.
> Under 0.5.2, the call to ssh_connect times out.  It seems that libssh is
> waiting for an event before doing anything with the data available on the
> socket.  However, the connect event, and any data receive events, have
> typically already occurred by the time that libssh gets control.
> 
> Has "ssh_options_set(session, SSH_OPTIONS_FD, &sock)" been tested with
> 0.5.2?
> If not, I will file a bug report.
> If it's been successfully tested, then I'll be scratching my head, wondering
> what I am doing wrong.
> 
> Here's a log of a call to ssh_connect:
> 
> 0824_210205.974 entering function ssh_connect line 628 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/client.c
> 0824_210205.975 libssh 0.5.2 (c) 2003-2010 Aris Adamantiadis
> (aris@xxxxxxxxxxxx) Distributed under the LGPL, please refer to COPYING file
> for information about your rights, using threading threads_noop
> 0824_210205.977 Socket connecting, now waiting for the callbacks to work
> 0824_210205.978 ssh_connect: Actual timeout : 10000
> 0824_210205.981 entering function ssh_handle_packets line 449 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/session.c
> 0824_210217.668 leaving function ssh_handle_packets line 474 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/session.c
> 0824_210217.673 Error : Timeout connecting to (null)
> 0824_210217.674 ssh_connect: Actual state : 9
> 0824_210217.676 leaving function ssh_connect line 707 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/client.c
> 0824_210217.678 Handshake with SFTP server failed: Timeout connecting to
> (null)
> 0824_210217.680 entering function ssh_silent_disconnect line 264 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/session.c
> 0824_210217.681 entering function ssh_disconnect line 765 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/client.c
> 0824_210217.683 leaving function ssh_disconnect line 845 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/client.c
> 0824_210217.684 leaving function ssh_silent_disconnect line 273 in
> /home/mrr/messageway/vendor/src/libssh/libssh-0.5.2/src/session.c
> 0824_210217.686 Disconnected
> 
> Thanks,
> 
> Mark R
> 
> 
> 
> 


Follow-Ups:
RE: Creating a session with a pre-connected socket in 0.5.2"Mark Riordan" <mriordan@xxxxxxxxxxxx>
References:
Creating a session with a pre-connected socket in 0.5.2"Mark Riordan" <mriordan@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org