cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2015126 ] poll gives WSAEINVAL when POLLPRI is set in fdset.events

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 10 Jul 2008 17:11:54 +0000

Bugs item #2015126, was opened at 2008-07-10 17:51
Message generated for change (Comment added) made by pelam
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2015126&group_id=976

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: libcurl
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter Lamberg (pelam)
Assigned to: Daniel Stenberg (bagder)
Summary: poll gives WSAEINVAL when POLLPRI is set in fdset.events

Initial Comment:
Hi

curl version: 7.18.2

Tried to build curl on VS 2005.
Single easy http fetch fails with CURLE_GOT_NOTHING.

Setting following in setup.h fixes the problem:
#undef POLLPRI
#define POLLPRI 0

The build uses Winsock 2.

The problem seems to be in Curl_socket_ready function.
Function sets POLLPRI bit to pollfd events field.

The POLLPRI seems to have value 0x0400 at least
in Windows platform sdk header winsock2.h.

poll (WSAPoll) then returns WSAEINVAL.

According to following page, POLLPRI is not among values for events field:
http://msdn.microsoft.com/en-us/library/ms740094(VS.85).aspx

My guess is that some windows update
added error checks that don't like POLLPRI.
Another possibility is that versions of the header files
have different values for POLLPRI.

Hope this helps...
Thanks for the cool software.

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

>Comment By: Peter Lamberg (pelam)
Date: 2008-07-10 20:11

Message:
Logged In: YES
user_id=116239
Originator: YES

Yup. The patch works. Thanks!

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

Comment By: Yang Tse (yangtse)
Date: 2008-07-10 19:44

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

Yes, MS maps priority (out-of-band) data to POLLRDBAND.

Can you verify if this patch works for you ?

Index: select.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/select.h,v
retrieving revision 1.15
diff -u -r1.15 select.h
--- select.h 22 Jan 2008 14:52:54 -0000 1.15
+++ select.h 10 Jul 2008 16:30:20 -0000
@@ -43,6 +43,8 @@
 #define HAVE_POLL_FINE 1
 #define poll(x,y,z) WSAPoll((x),(y),(z))
 #if defined(_MSC_VER) && defined(POLLRDNORM)
+#undef POLLPRI
+#define POLLPRI POLLRDBAND
 #define HAVE_STRUCT_POLLFD 1
 #endif
 #endif

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

Comment By: Yang Tse (yangtse)
Date: 2008-07-10 19:42

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

Yes, MS maps priority (out-of-band) data to POLLRDBAND.

Can you verify if this patch works for you ?

Index: select.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/select.h,v
retrieving revision 1.15
diff -u -r1.15 select.h
--- select.h 22 Jan 2008 14:52:54 -0000 1.15
+++ select.h 10 Jul 2008 16:30:20 -0000
@@ -43,6 +43,8 @@
 #define HAVE_POLL_FINE 1
 #define poll(x,y,z) WSAPoll((x),(y),(z))
 #if defined(_MSC_VER) && defined(POLLRDNORM)
+#undef POLLPRI
+#define POLLPRI POLLRDBAND
 #define HAVE_STRUCT_POLLFD 1
 #endif
 #endif

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2015126&group_id=976
Received on 2008-07-10

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET