On Thu, Jul 8, 2021 at 3:35 PM Stefan Eissing <stefan.eiss...@greenbytes.de> wrote: > >> > >> I needed to make small tweaks, because no all previous close checked the > >> return value and I got assert failures on your patch. > > > > Interesting, what error value was that? EBADF, EAGAIN? > > EBADF is what I saw.
Could you track somehow where the first close happened? Maybe: static void close_socket_nonblocking_ex(apr_socket_t *csd, const char *from) { apr_status_t rv; apr_os_sock_t fd = -1; apr_os_sock_get(&fd, csd); apr_socket_timeout_set(csd, 0); rv = apr_socket_close(csd); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(00468) "error closing socket %i/%pp from %s", (int)fd, csd, from); /*AP_DEBUG_ASSERT(0);*/ } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, ap_server_conf, "socket %i/%pp closed from %s", (int)fd, csd, from); } } #define close_socket_nonblocking(csd) close_socket_nonblocking_ex(csd, __FUNCTION__) to see if close_socket_nonblocking() is called twice or something.