Subject: [libssh2] [ libssh2-Bugs-1918953 ] SSH disconnect detection

[libssh2] [ libssh2-Bugs-1918953 ] SSH disconnect detection

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 18 Mar 2008 16:50:57 -0700

Bugs item #1918953, was opened at 2008-03-18 19:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1918953&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: misc
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gary Miller (gmiller1018)
Assigned to: Nobody/Anonymous (nobody)
Summary: SSH disconnect detection

Initial Comment:
When using libssh2_poll with a INT max timeout and a socket disconnects there does not seem to be any response. I had expected the libssh2_poll to return with the appropriate status indication.

Status passed in as:
[code]

cur_fd->fd.channel = sess_flags[I].channel; // channel
  cur_fd->type = LIBSSH2_POLLFD_CHANNEL;
  cur_fd->events = LIBSSH2_POLLFD_POLLIN |
                   LIBSSH2_POLLFD_POLLERR |
                   LIBSSH2_POLLFD_POLLHUP |
                   LIBSSH2_POLLFD_POLLNVAL |
                   LIBSSH2_POLLFD_SESSION_CLOSED |
                   LIBSSH2_POLLFD_CHANNEL_CLOSED;

twait = INT_MAX; // wait forever for input or disconn.
Log_debug("Waiting in libssh2_poll");
nfound = libssh2_poll (ssh_fds, count, twait);
Log_debug("libssh2_poll returned");

[/code]

there is only one socket open at the time and count is
set to 1 (in a select I would use 2). I am unsure if there is some behavior or other issue I need to consider to make this work. In past version of the library this worked but I had customized the code because of blocking behavior. This is pure latest release running on Fedora 7 using the RPM's. The connect and read and write appears to work correctly in general use but if the remote system server crashes the disconnect is not signaled so I never try to re-connect.

The socket have been set to non blocking by:
[code]
        libssh2_channel_set_blocking(sess_flags[I].channel,
   0); // make nonblocking
[/code]

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1918953&group_id=125852

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-03-19