| 342 | } |
| 343 | |
| 344 | static apr_status_t transit(h2_stream *stream, int new_state) |
| 345 | { |
| 346 | if ((h2_stream_state_t)new_state == stream->state) { |
| 347 | return APR_SUCCESS; |
| 348 | } |
| 349 | else if (new_state < 0) { |
| 350 | ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, stream->session->c1, |
| 351 | H2_STRM_LOG(APLOGNO(03081), stream, "invalid transition")); |
| 352 | on_state_invalid(stream); |
| 353 | return APR_EINVAL; |
| 354 | } |
| 355 | |
| 356 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->session->c1, |
| 357 | H2_STRM_MSG(stream, "transit to [%s]"), h2_ss_str(new_state)); |
| 358 | stream->state = new_state; |
| 359 | switch (new_state) { |
| 360 | case H2_SS_IDLE: |
| 361 | break; |
| 362 | case H2_SS_RSVD_L: |
| 363 | close_input(stream); |
| 364 | break; |
| 365 | case H2_SS_RSVD_R: |
| 366 | break; |
| 367 | case H2_SS_OPEN: |
| 368 | break; |
| 369 | case H2_SS_CLOSED_L: |
| 370 | break; |
| 371 | case H2_SS_CLOSED_R: |
| 372 | close_input(stream); |
| 373 | break; |
| 374 | case H2_SS_CLOSED: |
| 375 | close_input(stream); |
| 376 | if (stream->out_buffer) { |
| 377 | apr_brigade_cleanup(stream->out_buffer); |
| 378 | } |
| 379 | break; |
| 380 | case H2_SS_CLEANUP: |
| 381 | break; |
| 382 | } |
| 383 | on_state_enter(stream); |
| 384 | return APR_SUCCESS; |
| 385 | } |
| 386 | |
| 387 | void h2_stream_set_monitor(h2_stream *stream, h2_stream_monitor *monitor) |
| 388 | { |
no test coverage detected