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

Function ev_stream_closed

modules/http2/h2_session.c:1673–1692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673static void ev_stream_closed(h2_session *session, h2_stream *stream)
1674{
1675 apr_bucket *b;
1676
1677 if (H2_STREAM_CLIENT_INITIATED(stream->id)
1678 && (stream->id > session->local.completed_max)) {
1679 session->local.completed_max = stream->id;
1680 }
1681 /* The stream might have data in the buffers of the main connection.
1682 * We can only free the allocated resources once all had been written.
1683 * Send a special buckets on the connection that gets destroyed when
1684 * all preceding data has been handled. On its destruction, it is safe
1685 * to purge all resources of the stream. */
1686 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c1,
1687 H2_STRM_MSG(stream, "adding h2_eos to c1 out"));
1688 b = h2_bucket_eos_create(session->c1->bucket_alloc, stream);
1689 APR_BRIGADE_INSERT_TAIL(session->bbtmp, b);
1690 h2_c1_io_append(&session->io, session->bbtmp);
1691 apr_brigade_cleanup(session->bbtmp);
1692}
1693
1694static void on_stream_state_enter(void *ctx, h2_stream *stream)
1695{

Callers 1

on_stream_state_enterFunction · 0.85

Calls 2

h2_bucket_eos_createFunction · 0.85
h2_c1_io_appendFunction · 0.85

Tested by

no test coverage detected