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

Function close_input

modules/http2/h2_stream.c:268–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268static apr_status_t close_input(h2_stream *stream)
269{
270 conn_rec *c = stream->session->c1;
271 apr_status_t rv = APR_SUCCESS;
272 apr_bucket *b;
273
274 if (stream->input_closed) goto cleanup;
275
276 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->session->c1,
277 H2_STRM_MSG(stream, "closing input"));
278 if (!stream->rst_error
279 && stream->trailers_in
280 && !apr_is_empty_table(stream->trailers_in)) {
281 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1,
282 H2_STRM_MSG(stream, "adding trailers"));
283#if AP_HAS_RESPONSE_BUCKETS
284 b = ap_bucket_headers_create(stream->trailers_in,
285 stream->pool, c->bucket_alloc);
286#else
287 b = h2_bucket_headers_create(c->bucket_alloc,
288 h2_headers_create(HTTP_OK, stream->trailers_in, NULL,
289 stream->in_trailer_octets, stream->pool));
290#endif
291 input_append_bucket(stream, b);
292 stream->trailers_in = NULL;
293 }
294
295 stream->input_closed = 1;
296 if (stream->input) {
297 b = apr_bucket_eos_create(c->bucket_alloc);
298 input_append_bucket(stream, b);
299 input_flush(stream);
300 h2_stream_dispatch(stream, H2_SEV_IN_DATA_PENDING);
301 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1,
302 H2_STRM_MSG(stream, "input flush + EOS"));
303 }
304
305cleanup:
306 return rv;
307}
308
309static void on_state_enter(h2_stream *stream)
310{

Callers 1

transitFunction · 0.85

Calls 5

h2_bucket_headers_createFunction · 0.85
h2_headers_createFunction · 0.85
input_append_bucketFunction · 0.85
input_flushFunction · 0.85
h2_stream_dispatchFunction · 0.85

Tested by

no test coverage detected