MCPcopy Create free account
hub / github.com/apache/trafficserver / Http2Stream

Method Http2Stream

src/proxy/http2/Http2Stream.cc:54–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52ClassAllocator<Http2Stream> http2StreamAllocator("http2StreamAllocator");
53
54Http2Stream::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
86Http2Stream::~Http2Stream()
87{

Callers

nothing calls this directly

Calls 7

mark_milestoneMethod · 0.95
this_ethreadFunction · 0.85
http_parser_initFunction · 0.85
alloc_readerMethod · 0.80
is_outboundMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected