You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2011/11/16 16:30:50 UTC

DO NOT REPLY [Bug 52198] New: incomplete results from poll/unix/select.c:impl_pollset_poll()

https://issues.apache.org/bugzilla/show_bug.cgi?id=52198

             Bug #: 52198
           Summary: incomplete results from
                    poll/unix/select.c:impl_pollset_poll()
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: eric@vdmaarel.nl
    Classification: Unclassified


Created attachment 27955
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27955
patch of  poll/unix/select.c

In Windows XP select is used in socket polling. The present poll implementation
based on select() has no way to set the POLLHUP and/or POLLERR flags in a poll
return event. As noted in
http://mail-archives.apache.org/mod_mbox/apr-dev/201105.mbox/ajax/%3C4DC12E28.8010402%40nedap.com%3E
the Comet functionality in the Tomcat Native project based on apr, depends on
receiving those return values when a client 'unexpectedly' disconnects. When
that doesn't happen the result is a 100% CPU when the last client disconnects.
As such we find that to happen on Windows XP.

So, I propose a patch here that uses the recv() function to peek at the fd when
it has been found to be ready for read. In the case a connection has been
gracefully closed the result == 0 and the APR_POLLHUP flag is set in the return
event. When the result < 0 there must be an error and the APR_POLLERR flag is
set.

This peeking is added to impl_pollset_poll() and apr_poll().

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52198] incomplete results from poll/unix/select.c:impl_pollset_poll()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52198

eric <er...@vdmaarel.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52198] incomplete results from poll/unix/select.c:impl_pollset_poll()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52198

eric <er...@vdmaarel.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #27955|application/octet-stream    |text/plain
          mime type|                            |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org