| 2014 | } |
| 2015 | |
| 2016 | bool |
| 2017 | Http2ConnectionState::delete_stream(Http2Stream *stream) |
| 2018 | { |
| 2019 | ink_assert(nullptr != stream); |
| 2020 | SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); |
| 2021 | |
| 2022 | // If stream has already been removed from the list, just go on |
| 2023 | if (!stream_list.in(stream)) { |
| 2024 | return false; |
| 2025 | } |
| 2026 | |
| 2027 | Http2StreamDebug(session, stream->get_id(), "Delete stream"); |
| 2028 | REMEMBER(NO_EVENT, this->recursion); |
| 2029 | |
| 2030 | if (Http2::stream_priority_enabled) { |
| 2031 | Http2DependencyTree::Node *node = stream->priority_node; |
| 2032 | Http2DependencyTree::Node *node_by_id = this->dependency_tree->find(stream->get_id()); |
| 2033 | ink_assert(node == node_by_id); |
| 2034 | if (node != nullptr) { |
| 2035 | if (node->active) { |
| 2036 | dependency_tree->deactivate(node, 0); |
| 2037 | } |
| 2038 | if (dbg_ctl_http2_priority.on()) { |
| 2039 | std::stringstream output; |
| 2040 | dependency_tree->dump_tree(output); |
| 2041 | Dbg(dbg_ctl_http2_priority, "[%" PRId64 "] %s", session->get_connection_id(), output.str().c_str()); |
| 2042 | } |
| 2043 | dependency_tree->remove(node); |
| 2044 | // ink_release_assert(dependency_tree->find(stream->get_id()) == nullptr); |
| 2045 | } |
| 2046 | stream->priority_node = nullptr; |
| 2047 | } |
| 2048 | |
| 2049 | if (stream->get_state() != Http2StreamState::HTTP2_STREAM_STATE_CLOSED) { |
| 2050 | send_rst_stream_frame(stream->get_id(), Http2ErrorCode::HTTP2_ERROR_NO_ERROR); |
| 2051 | } |
| 2052 | |
| 2053 | stream_list.remove(stream); |
| 2054 | if (http2_is_client_streamid(stream->get_id())) { |
| 2055 | ink_release_assert(peer_streams_count_in > 0); |
| 2056 | --peer_streams_count_in; |
| 2057 | if (!fini_received && is_peer_concurrent_stream_lb()) { |
| 2058 | session->add_session(); |
| 2059 | } |
| 2060 | } else { |
| 2061 | ink_assert(peer_streams_count_out > 0); |
| 2062 | --peer_streams_count_out; |
| 2063 | } |
| 2064 | // total_peer_streams_count will be decremented in release_stream(), because it's a counter include streams in the process of |
| 2065 | // shutting down. |
| 2066 | |
| 2067 | stream->initiating_close(); |
| 2068 | |
| 2069 | return true; |
| 2070 | } |
| 2071 | |
| 2072 | void |
| 2073 | Http2ConnectionState::release_stream() |
no test coverage detected