| 580 | #endif |
| 581 | |
| 582 | h2_stream *h2_stream_create(int id, apr_pool_t *pool, h2_session *session, |
| 583 | h2_stream_monitor *monitor, int initiated_on) |
| 584 | { |
| 585 | h2_stream *stream = apr_pcalloc(pool, sizeof(h2_stream)); |
| 586 | |
| 587 | H2_STRM_ASSIGN_MAGIC(stream, H2_STRM_MAGIC_OK); |
| 588 | stream->id = id; |
| 589 | stream->initiated_on = initiated_on; |
| 590 | stream->created = apr_time_now(); |
| 591 | stream->state = H2_SS_IDLE; |
| 592 | stream->pool = pool; |
| 593 | stream->session = session; |
| 594 | stream->monitor = monitor; |
| 595 | #ifdef AP_DEBUG |
| 596 | if (id) { /* stream 0 has special lifetime */ |
| 597 | apr_pool_cleanup_register(pool, stream, stream_pool_destroy, |
| 598 | apr_pool_cleanup_null); |
| 599 | } |
| 600 | #endif |
| 601 | |
| 602 | #ifdef H2_NG2_LOCAL_WIN_SIZE |
| 603 | if (id) { |
| 604 | stream->in_window_size = |
| 605 | nghttp2_session_get_stream_local_window_size( |
| 606 | stream->session->ngh2, stream->id); |
| 607 | } |
| 608 | #endif |
| 609 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c1, |
| 610 | H2_STRM_LOG(APLOGNO(03082), stream, "created")); |
| 611 | on_state_enter(stream); |
| 612 | return stream; |
| 613 | } |
| 614 | |
| 615 | void h2_stream_cleanup(h2_stream *stream) |
| 616 | { |
no test coverage detected