mirror of
https://github.com/apache/httpd.git
synced 2025-08-16 16:17:23 +00:00
ab: Add POLLERR and POLLHUP to reqevents for implementations that use/need it.
Also, apr_pollset_remove() might return APR_NOTFOUND if a connection is reset while being poll()ed, don't treat it as an error. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
12
support/ab.c
12
support/ab.c
@ -599,10 +599,20 @@ static int set_polled_events(struct connection *c, apr_int16_t new_reqevents)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
/* Add POLLHUP and POLLERR to reqevents should some pollset
|
||||
* implementations need/use them.
|
||||
*/
|
||||
if (new_reqevents != 0) {
|
||||
new_reqevents |= APR_POLLERR;
|
||||
if (new_reqevents & APR_POLLIN) {
|
||||
new_reqevents |= APR_POLLHUP;
|
||||
}
|
||||
}
|
||||
|
||||
if (c->pollfd.reqevents != new_reqevents) {
|
||||
if (c->pollfd.reqevents != 0) {
|
||||
rv = apr_pollset_remove(c->worker->pollset, &c->pollfd);
|
||||
if (rv != APR_SUCCESS) {
|
||||
if (rv != APR_SUCCESS && !APR_STATUS_IS_NOTFOUND(rv)) {
|
||||
graceful_strerror("apr_pollset_remove()", rv);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user