| 52 | ClassAllocator<Http2Stream> http2StreamAllocator("http2StreamAllocator"); |
| 53 | |
| 54 | Http2Stream::Http2Stream(ProxySession *session, Http2StreamId sid, ssize_t initial_peer_rwnd, ssize_t initial_local_rwnd, |
| 55 | bool registered_stream) |
| 56 | : super(session), _id(sid), _registered_stream(registered_stream), _peer_rwnd(initial_peer_rwnd), _local_rwnd(initial_local_rwnd) |
| 57 | { |
| 58 | SET_HANDLER(&Http2Stream::main_event_handler); |
| 59 | |
| 60 | this->mark_milestone(Http2StreamMilestone::OPEN); |
| 61 | |
| 62 | this->_sm = nullptr; |
| 63 | this->_thread = this_ethread(); |
| 64 | this->_state = Http2StreamState::HTTP2_STREAM_STATE_IDLE; |
| 65 | |
| 66 | auto const *proxy_session = get_proxy_ssn(); |
| 67 | ink_assert(proxy_session != nullptr); |
| 68 | auto const *h2_session = dynamic_cast<Http2CommonSession const *>(proxy_session); |
| 69 | ink_assert(h2_session != nullptr); |
| 70 | this->_is_outbound = h2_session->is_outbound(); |
| 71 | |
| 72 | this->_reader = this->_receive_buffer.alloc_reader(); |
| 73 | |
| 74 | if (this->is_outbound_connection()) { // Flip the sense of the expected headers. Fix naming later |
| 75 | _receive_header.create(HTTP_TYPE_RESPONSE); |
| 76 | _send_header.create(HTTP_TYPE_REQUEST, HTTP_2_0); |
| 77 | } else { |
| 78 | this->upstream_outbound_options = *(session->accept_options); |
| 79 | _receive_header.create(HTTP_TYPE_REQUEST); |
| 80 | _send_header.create(HTTP_TYPE_RESPONSE, HTTP_2_0); |
| 81 | } |
| 82 | |
| 83 | http_parser_init(&http_parser); |
| 84 | } |
| 85 | |
| 86 | Http2Stream::~Http2Stream() |
| 87 | { |
nothing calls this directly
no test coverage detected