SourceForge.net | 2 Jan 2008 15:46
Picon
Favicon

[ libssh2-Bugs-1860989 ] libssh2_poll handles -1 timeout incorrectly

Bugs item #1860989, was opened at 2007-12-30 18:08
Message generated for change (Comment added) made by bagder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1860989&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: API
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: jls (apjenkins)
>Assigned to: Daniel Stenberg (bagder)
Summary: libssh2_poll handles -1 timeout incorrectly

Initial Comment:
The documentation for libssh2_poll says the semantics are like poll(2).  However poll(2) accepts a -1
timeout, which means to wait indefinitely.  libssh2_poll  does not correctly handle a -1 timeout.  It seems
like the only way to indicate an indefinite wait is to pass a really large timeout to libssh2_poll.  I think
either the documentation should mention that libssh2_poll differs from poll(2) in this way, or a -1
timeout should be supported as meaning wait indefinitely.

Currently, if you look in libssh2_poll code, it performs arithmetic on timeout_remaining without first
checking to see if it's negative.  I can submit a patch to make libssh2_poll support -1 like poll(2) if you'd like.

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

(Continue reading)

SourceForge.net | 2 Jan 2008 15:49
Picon
Favicon

[ libssh2-Bugs-1841442 ] libssh2-0.18 session.c

Bugs item #1841442, was opened at 2007-11-30 05:56
Message generated for change (Comment added) made by bagder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1841442&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: API
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gary Miller (gmiller1018)
Assigned to: Daniel Stenberg (bagder)
Summary: libssh2-0.18 session.c

Initial Comment:
I have noticed an issue with libssh2_poll on my Linux machines.  I found that on my machines HAVE_POLL and
HAVE_SELECT are defined and the code that is executed in the poll code not the select.  I fixed this by just
undef'ing the HAVE_POLL.

The other issue here is when the select code is enabled the code in the libssh2_poll seems to be in error.  The
code as I fixed it is:
[code]
        if (sysret > 0) {
            for(i = 0; i < nfds; i++) {
                switch (fds[i].type) {
                case LIBSSH2_POLLFD_SOCKET:
(Continue reading)

SourceForge.net | 2 Jan 2008 22:28
Picon
Favicon

[ libssh2-Bugs-1862722 ] libssh2_poll doesn't work on win32

Bugs item #1862722, was opened at 2008-01-02 13:28
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=1862722&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_poll doesn't work on win32

Initial Comment:
Using libssh2 0.18, I found that libssh2_poll doesn't work on win32. It would always return 1, and the
revents field of the LIBSSH2_POLLFD object I passed in would be set to garbage.  

I found that the reason for this was that on WIN32, neither HAVE_SELECT nor HAVE_POLL get defined.  The way
libssh2_poll is written assumes that either the "ifdef HAVE_POLL" or "ifdef HAVE_SELECT" block of code
will get exected.  If neither executes then no packets ever actually get read, it it just returns garbage.

Since Win32 does provide select, I simply defined HAVE_SELECT in win32/libssh2_config.h, and also made a
small change to libssh2_priv.h so it won't try to include unix-only header files on windows.  This made
libssh2_poll work correctly on Windows.  I've tested this patch with VStudio 2003 on a win32 machine, and
VStudio 2005 on a win64 machine.   
(Continue reading)

SourceForge.net | 2 Jan 2008 22:33
Picon
Favicon

[ libssh2-Bugs-1862727 ] libssh2_poll doesn't work on win32

Bugs item #1862727, was opened at 2008-01-02 16:33
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=1862727&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: jls (apjenkins)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_poll doesn't work on win32

Initial Comment:
[Sorry, this is a duplicate of bug 1862722, which I submitted anonymously by mistake]

Using libssh2 0.18, I found that libssh2_poll doesn't work on win32. It would always return 1, and the
revents field of the LIBSSH2_POLLFD object I passed in would be set to garbage.

I found that the reason for this was that on WIN32, neither HAVE_SELECT nor HAVE_POLL get defined. The way
libssh2_poll is written assumes that either the "ifdef HAVE_POLL" or "ifdef HAVE_SELECT" block of code
will get
exected. If neither executes then no packets ever actually get read, it it just returns garbage.

Since Win32 does provide select, I simply defined HAVE_SELECT in win32/libssh2_config.h, and also made a
(Continue reading)

SourceForge.net | 3 Jan 2008 14:26
Picon
Favicon

[ libssh2-Bugs-1863153 ] debugging output left in channel.c in 0.18

Bugs item #1863153, was opened at 2008-01-03 05:26
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=1863153&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: debugging output left in channel.c in 0.18 

Initial Comment:
In release 0.18 on line 1417 of channel.c the debugging output:
fprintf(stderr, "return rc = %d\n", rc);
has been left in the release.

Low priority and not really important I know... ;)

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

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

(Continue reading)

SourceForge.net | 3 Jan 2008 14:30
Picon
Favicon

[ libssh2-Feature Requests-1863154 ] Only private key should be needed by libssh2_userauth_public

Feature Requests item #1863154, was opened at 2008-01-03 05:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703945&aid=1863154&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: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Only private key should be needed by libssh2_userauth_public

Initial Comment:
The current API allows you to authenticate using a public key authentication using the
libssh2_userauth_publickey_fromfile call.

However, this means having the private and public key saved to disk. The public key can always be created
from the private key so this parameter isn't really needed and would make the library slightly easier to
use and any applications based on it easier to configure.

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

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

(Continue reading)

Paul Thomas | 3 Jan 2008 17:27
Picon

Feature Request (code included)

Developers,

Vincent Jaulin gave me a function that isn't in your library. It lets
the open shell session receive resize hints. Would you add it to the
library please? Here's the code and I can verify that it works.

Thanks,
Paul Thomas

code
----------------------------------

LIBSSH2_API int
libssh2_channel_request_pty_size(LIBSSH2_CHANNEL * channel, int width,
int height,
                             int width_px, int height_px)
{
  LIBSSH2_SESSION *session = channel->session;
  unsigned char *s, *data;
  static const unsigned char reply_codes[3] =
      { SSH_MSG_CHANNEL_SUCCESS, SSH_MSG_CHANNEL_FAILURE, 0 };
  unsigned long data_len;
  int rc;

  if (channel->reqPTY_state == libssh2_NB_state_idle) {
      /* 41 = packet_type(1) + channel(4) + pty_req_len(4) +
"window-change"(13) +
       * want_reply(1) + width(4) + height(4) + width_px(4) +
       * height_px(4)  */
      channel->reqPTY_packet_len = 39;
(Continue reading)

SourceForge.net | 3 Jan 2008 20:13
Picon
Favicon

[ libssh2-Bugs-1863153 ] debugging output left in channel.c in 0.18

Bugs item #1863153, was opened at 2008-01-03 05:26
Message generated for change (Comment added) made by dfandrich
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1863153&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: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Dan Fandrich (dfandrich)
Summary: debugging output left in channel.c in 0.18 

Initial Comment:
In release 0.18 on line 1417 of channel.c the debugging output:
fprintf(stderr, "return rc = %d\n", rc);
has been left in the release.

Low priority and not really important I know... ;)

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

>Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-03 11:13

(Continue reading)

SourceForge.net | 3 Jan 2008 20:15
Picon
Favicon

[ libssh2-Bugs-1862722 ] libssh2_poll doesn't work on win32

Bugs item #1862722, was opened at 2008-01-02 13:28
Message generated for change (Comment added) made by dfandrich
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1862722&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: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_poll doesn't work on win32

Initial Comment:
Using libssh2 0.18, I found that libssh2_poll doesn't work on win32. It would always return 1, and the
revents field of the LIBSSH2_POLLFD object I passed in would be set to garbage.  

I found that the reason for this was that on WIN32, neither HAVE_SELECT nor HAVE_POLL get defined.  The way
libssh2_poll is written assumes that either the "ifdef HAVE_POLL" or "ifdef HAVE_SELECT" block of code
will get exected.  If neither executes then no packets ever actually get read, it it just returns garbage.

Since Win32 does provide select, I simply defined HAVE_SELECT in win32/libssh2_config.h, and also made a
small change to libssh2_priv.h so it won't try to include unix-only header files on windows.  This made
libssh2_poll work correctly on Windows.  I've tested this patch with VStudio 2003 on a win32 machine, and
VStudio 2005 on a win64 machine.   
(Continue reading)

Daniel Stenberg | 3 Jan 2008 22:39
Picon
Favicon
Gravatar

Re: Feature Request (code included)

On Jan 3, 2008 5:27 PM, Paul Thomas <thomaspu@...> wrote:

> Vincent Jaulin gave me a function that isn't in your library. It lets
> the open shell session receive resize hints. Would you add it to the
> library please? Here's the code and I can verify that it works.

So he allows you to submit it to us? If so, can you please make an
actual patch of it and resend together with at least some basic docs?
Oh, and please don't use // for commenting the code as it breaks
(older) compiles.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane