apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52198] New: incomplete results from poll/unix/select.c:impl_pollset_poll()
Date Wed, 16 Nov 2011 15:30:50 GMT
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


Mime
View raw message