cs->pub.sense = CONN_SENSE_DEFAULT;
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_APPEND(q, cs);
- apr_thread_mutex_unlock(timeout_mutex);
rv = apr_pollset_add(event_pollset, &cs->pfd);
+ apr_thread_mutex_unlock(timeout_mutex);
if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(03092)
"start_lingering_close: apr_pollset_add failure");
cs->pub.sense = CONN_SENSE_DEFAULT;
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_APPEND(cs->sc->wc_q, cs);
- apr_thread_mutex_unlock(timeout_mutex);
rc = apr_pollset_add(event_pollset, &cs->pfd);
- if (rc != APR_SUCCESS) {
+ apr_thread_mutex_unlock(timeout_mutex);
+ if (rc != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rc)) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf, APLOGNO(03465)
"process_socket: apr_pollset_add failure for "
"write completion");
cs->pfd.reqevents = APR_POLLIN;
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_APPEND(cs->sc->ka_q, cs);
- apr_thread_mutex_unlock(timeout_mutex);
-
rc = apr_pollset_add(event_pollset, &cs->pfd);
- if (rc != APR_SUCCESS) {
+ apr_thread_mutex_unlock(timeout_mutex);
+ if (rc != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rc)) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf, APLOGNO(03093)
"process_socket: apr_pollset_add failure for "
"keep alive");
cs->pub.sense = CONN_SENSE_DEFAULT;
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_APPEND(cs->sc->wc_q, cs);
- apr_thread_mutex_unlock(timeout_mutex);
apr_pollset_add(event_pollset, &cs->pfd);
+ apr_thread_mutex_unlock(timeout_mutex);
return OK;
}
return;
}
- rv = apr_pollset_remove(event_pollset, pfd);
- AP_DEBUG_ASSERT(rv == APR_SUCCESS);
-
- rv = apr_socket_close(csd);
- AP_DEBUG_ASSERT(rv == APR_SUCCESS);
-
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_REMOVE(q, cs);
+ rv = apr_pollset_remove(event_pollset, pfd);
apr_thread_mutex_unlock(timeout_mutex);
+ AP_DEBUG_ASSERT(rv == APR_SUCCESS || APR_STATUS_IS_NOTFOUND(rv));
TO_QUEUE_ELEM_INIT(cs);
+ rv = apr_socket_close(csd);
+ AP_DEBUG_ASSERT(rv == APR_SUCCESS);
+
ap_push_pool(worker_queue_info, cs->p);
if (dying)
ap_queue_interrupt_one(worker_queue);
&workers_were_busy);
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_REMOVE(remove_from_q, cs);
+ rc = apr_pollset_remove(event_pollset, &cs->pfd);
apr_thread_mutex_unlock(timeout_mutex);
-
/*
* Some of the pollset backends, like KQueue or Epoll
* automagically remove the FD if the socket is closed,
* therefore, we can accept _SUCCESS or _NOTFOUND,
* and we still want to keep going
*/
- rc = apr_pollset_remove(event_pollset, &cs->pfd);
if (rc != APR_SUCCESS && !APR_STATUS_IS_NOTFOUND(rc)) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf,
APLOGNO(03094) "pollset remove failed");