| 838 | } |
| 839 | |
| 840 | static apr_status_t session_cleanup(h2_session *session, const char *trigger) |
| 841 | { |
| 842 | conn_rec *c = session->c1; |
| 843 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, |
| 844 | H2_SSSN_MSG(session, "pool_cleanup")); |
| 845 | |
| 846 | if (session->state != H2_SESSION_ST_DONE |
| 847 | && session->state != H2_SESSION_ST_INIT) { |
| 848 | /* Not good. The connection is being torn down and we have |
| 849 | * not sent a goaway. This is considered a protocol error and |
| 850 | * the client has to assume that any streams "in flight" may have |
| 851 | * been processed and are not safe to retry. |
| 852 | * As clients with idle connection may only learn about a closed |
| 853 | * connection when sending the next request, this has the effect |
| 854 | * that at least this one request will fail. |
| 855 | */ |
| 856 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, |
| 857 | H2_SSSN_LOG(APLOGNO(03199), session, |
| 858 | "connection disappeared without proper " |
| 859 | "goodbye, clients will be confused, should not happen")); |
| 860 | } |
| 861 | |
| 862 | if (!h2_iq_empty(session->ready_to_process)) { |
| 863 | int sid; |
| 864 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, |
| 865 | H2_SSSN_LOG(APLOGNO(10485), session, |
| 866 | "cleanup, resetting %d streams in ready-to-process"), |
| 867 | h2_iq_count(session->ready_to_process)); |
| 868 | while ((sid = h2_iq_shift(session->ready_to_process)) > 0) { |
| 869 | h2_mplx_c1_client_rst(session->mplx, sid, get_stream(session, sid)); |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | transit(session, trigger, H2_SESSION_ST_CLEANUP); |
| 874 | h2_mplx_c1_destroy(session->mplx); |
| 875 | session->mplx = NULL; |
| 876 | |
| 877 | ap_assert(session->ngh2); |
| 878 | nghttp2_session_del(session->ngh2); |
| 879 | session->ngh2 = NULL; |
| 880 | h2_conn_ctx_detach(c); |
| 881 | |
| 882 | return APR_SUCCESS; |
| 883 | } |
| 884 | |
| 885 | static apr_status_t session_pool_cleanup(void *data) |
| 886 | { |
no test coverage detected