MCPcopy Create free account
hub / github.com/apache/httpd / m_stream_cleanup

Function m_stream_cleanup

modules/http2/h2_mplx.c:149–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static void m_stream_cleanup(h2_mplx *m, h2_stream *stream)
150{
151 h2_conn_ctx_t *c2_ctx = h2_conn_ctx_get(stream->c2);
152
153 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
154 H2_STRM_MSG(stream, "cleanup, unsubscribing from beam events"));
155 if (c2_ctx) {
156 if (c2_ctx->beam_out) {
157 h2_beam_on_was_empty(c2_ctx->beam_out, NULL, NULL);
158 }
159 if (c2_ctx->beam_in) {
160 h2_beam_on_send(c2_ctx->beam_in, NULL, NULL);
161 h2_beam_on_received(c2_ctx->beam_in, NULL, NULL);
162 h2_beam_on_eagain(c2_ctx->beam_in, NULL, NULL);
163 h2_beam_on_consumed(c2_ctx->beam_in, NULL, NULL);
164 }
165 }
166
167 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
168 H2_STRM_MSG(stream, "cleanup, removing from registries"));
169 ap_assert(stream->state == H2_SS_CLEANUP);
170 h2_stream_cleanup(stream);
171 h2_ihash_remove(m->streams, stream->id);
172 h2_iq_remove(m->q, stream->id);
173
174 if (c2_ctx) {
175 if (!stream_is_running(stream)) {
176 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
177 H2_STRM_MSG(stream, "cleanup, c2 is done, move to spurge"));
178 /* processing has finished */
179 add_for_purge(m, stream);
180 }
181 else {
182 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
183 H2_STRM_MSG(stream, "cleanup, c2 is running, abort"));
184 /* c2 is still running */
185 h2_c2_abort(stream->c2, m->c1);
186 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
187 H2_STRM_MSG(stream, "cleanup, c2 is done, move to shold"));
188 h2_ihash_add(m->shold, stream);
189 }
190 }
191 else {
192 /* never started */
193 int added = add_for_purge(m, stream);
194 if (added)
195 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c1,
196 H2_STRM_MSG(stream, "cleanup, never started, move to spurge"));
197 }
198}
199
200static h2_c2_transit *c2_transit_create(h2_mplx *m)
201{

Callers 3

m_stream_cancel_iterFunction · 0.85
h2_mplx_c1_client_rstFunction · 0.85

Calls 12

h2_beam_on_was_emptyFunction · 0.85
h2_beam_on_sendFunction · 0.85
h2_beam_on_receivedFunction · 0.85
h2_beam_on_eagainFunction · 0.85
h2_beam_on_consumedFunction · 0.85
h2_stream_cleanupFunction · 0.85
h2_ihash_removeFunction · 0.85
h2_iq_removeFunction · 0.85
stream_is_runningFunction · 0.85
add_for_purgeFunction · 0.85
h2_c2_abortFunction · 0.85
h2_ihash_addFunction · 0.85

Tested by

no test coverage detected