int h2_mplx_in_has_eos_for(h2_mplx *m, int stream_id) { AP_DEBUG_ASSERT(m); if (m->aborted) { return 0; } int has_eos = 0; apr_status_t status = apr_thread_mutex_lock(m->lock); if (APR_SUCCESS == status) { h2_io *io = h2_io_set_get(m->stream_ios, stream_id); if (io) { has_eos = h2_io_in_has_eos_for(io); } apr_thread_mutex_unlock(m->lock); } return has_eos; }
int h2_mplx_in_has_eos_for(h2_mplx *m, int stream_id) { int has_eos = 0; int acquired; apr_status_t status; AP_DEBUG_ASSERT(m); if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) { h2_io *io = h2_io_set_get(m->stream_ios, stream_id); if (io && !io->orphaned) { has_eos = h2_io_in_has_eos_for(io); } else { has_eos = 1; } leave_mutex(m, acquired); } return has_eos; }