| 390 | } |
| 391 | |
| 392 | void h2_stream_dispatch(h2_stream *stream, h2_stream_event_t ev) |
| 393 | { |
| 394 | int new_state; |
| 395 | |
| 396 | H2_STRM_ASSERT_MAGIC(stream, H2_STRM_MAGIC_OK); |
| 397 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1, |
| 398 | H2_STRM_MSG(stream, "dispatch event %d"), ev); |
| 399 | new_state = on_event(stream, ev); |
| 400 | if (new_state < 0) { |
| 401 | ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, stream->session->c1, |
| 402 | H2_STRM_LOG(APLOGNO(10002), stream, "invalid event %d"), ev); |
| 403 | on_state_invalid(stream); |
| 404 | AP_DEBUG_ASSERT(new_state > S_XXX); |
| 405 | return; |
| 406 | } |
| 407 | else if ((h2_stream_state_t)new_state == stream->state) { |
| 408 | /* nop */ |
| 409 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1, |
| 410 | H2_STRM_MSG(stream, "non-state event %d"), ev); |
| 411 | return; |
| 412 | } |
| 413 | else { |
| 414 | on_state_event(stream, ev); |
| 415 | transit(stream, new_state); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | static void set_policy_for(h2_stream *stream, h2_request *r) |
| 420 | { |
no test coverage detected