| 1692 | } |
| 1693 | |
| 1694 | static void on_stream_state_enter(void *ctx, h2_stream *stream) |
| 1695 | { |
| 1696 | h2_session *session = ctx; |
| 1697 | |
| 1698 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c1, |
| 1699 | H2_STRM_MSG(stream, "entered state")); |
| 1700 | switch (stream->state) { |
| 1701 | case H2_SS_IDLE: /* stream was created */ |
| 1702 | ev_stream_created(session, stream); |
| 1703 | break; |
| 1704 | case H2_SS_OPEN: /* stream has request headers */ |
| 1705 | case H2_SS_RSVD_L: |
| 1706 | ev_stream_open(session, stream); |
| 1707 | break; |
| 1708 | case H2_SS_CLOSED_L: /* stream output was closed, but remote end is not */ |
| 1709 | /* If the stream is still being processed, it could still be reading |
| 1710 | * its input (theoretically, http request hangling does not normally). |
| 1711 | * But when processing is done, we need to cancel the stream as no |
| 1712 | * one is consuming the input any longer. |
| 1713 | * This happens, for example, on a large POST when the response |
| 1714 | * is ready early due to the POST being denied. */ |
| 1715 | if (!h2_mplx_c1_stream_is_running(session->mplx, stream)) { |
| 1716 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c1, |
| 1717 | H2_STRM_LOG(APLOGNO(10305), stream, "remote close missing")); |
| 1718 | nghttp2_submit_rst_stream(session->ngh2, NGHTTP2_FLAG_NONE, |
| 1719 | stream->id, H2_ERR_NO_ERROR); |
| 1720 | } |
| 1721 | break; |
| 1722 | case H2_SS_CLOSED_R: /* stream input was closed */ |
| 1723 | break; |
| 1724 | case H2_SS_CLOSED: /* stream in+out were closed */ |
| 1725 | ev_stream_closed(session, stream); |
| 1726 | break; |
| 1727 | case H2_SS_CLEANUP: |
| 1728 | nghttp2_session_set_stream_user_data(session->ngh2, stream->id, NULL); |
| 1729 | update_child_status(session, SERVER_BUSY_WRITE, "done", stream); |
| 1730 | h2_mplx_c1_stream_cleanup(session->mplx, stream, &session->open_streams); |
| 1731 | stream = NULL; |
| 1732 | ++session->streams_done; |
| 1733 | break; |
| 1734 | default: |
| 1735 | break; |
| 1736 | } |
| 1737 | } |
| 1738 | |
| 1739 | static void on_stream_event(void *ctx, h2_stream *stream, h2_stream_event_t ev) |
| 1740 | { |
nothing calls this directly
no test coverage detected