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

Function h2_c1_io_append

modules/http2/h2_c1_io.c:375–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375apr_status_t h2_c1_io_append(h2_c1_io *io, apr_bucket_brigade *bb)
376{
377 apr_bucket *b;
378 apr_status_t rv = APR_SUCCESS;
379
380 while (!APR_BRIGADE_EMPTY(bb)) {
381 b = APR_BRIGADE_FIRST(bb);
382 if (APR_BUCKET_IS_METADATA(b) || APR_BUCKET_IS_MMAP(b)) {
383 /* need to finish any open scratch bucket, as meta data
384 * needs to be forward "in order". */
385 append_scratch(io);
386 APR_BUCKET_REMOVE(b);
387 APR_BRIGADE_INSERT_TAIL(io->output, b);
388 }
389 else {
390 apr_size_t remain = assure_scratch_space(io);
391 if (b->length > remain) {
392 apr_bucket_split(b, remain);
393 if (io->slen == 0) {
394 /* complete write_size bucket, append unchanged */
395 APR_BUCKET_REMOVE(b);
396 APR_BRIGADE_INSERT_TAIL(io->output, b);
397 io->buffered_len += b->length;
398 continue;
399 }
400 }
401 else {
402 /* bucket fits in remain, copy to scratch */
403 rv = read_to_scratch(io, b);
404 apr_bucket_delete(b);
405 if (APR_SUCCESS != rv) goto cleanup;
406 continue;
407 }
408 }
409 }
410cleanup:
411 return rv;
412}
413
414static apr_status_t c1_in_feed_bucket(h2_session *session,
415 apr_bucket *b, apr_ssize_t *inout_len)

Callers 2

on_send_data_cbFunction · 0.85
ev_stream_closedFunction · 0.85

Calls 3

append_scratchFunction · 0.85
assure_scratch_spaceFunction · 0.85
read_to_scratchFunction · 0.85

Tested by

no test coverage detected