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.   

The patch file is attached.


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

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

Message:
Logged In: YES 
user_id=236775
Originator: NO

Duplicate of bug #1862727

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

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

-------------------------------------------------------------------------
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/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to