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

Function h2_brigade_concat_length

modules/http2/h2_util.c:1193–1226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193apr_status_t h2_brigade_concat_length(apr_bucket_brigade *dest,
1194 apr_bucket_brigade *src,
1195 apr_off_t length)
1196{
1197 apr_bucket *b;
1198 apr_off_t remain = length;
1199 apr_status_t status = APR_SUCCESS;
1200
1201 while (!APR_BRIGADE_EMPTY(src)) {
1202 b = APR_BRIGADE_FIRST(src);
1203
1204 if (APR_BUCKET_IS_METADATA(b)) {
1205 APR_BUCKET_REMOVE(b);
1206 APR_BRIGADE_INSERT_TAIL(dest, b);
1207 }
1208 else {
1209 if (remain <= 0) {
1210 return status;
1211 }
1212 if (b->length == ((apr_size_t)-1)) {
1213 const char *ign;
1214 apr_size_t ilen;
1215 status = apr_bucket_read(b, &ign, &ilen, APR_BLOCK_READ);
1216 if (status != APR_SUCCESS) {
1217 return status;
1218 }
1219 }
1220 fit_bucket_into(b, &remain);
1221 APR_BUCKET_REMOVE(b);
1222 APR_BRIGADE_INSERT_TAIL(dest, b);
1223 }
1224 }
1225 return status;
1226}
1227
1228apr_status_t h2_brigade_copy_length(apr_bucket_brigade *dest,
1229 apr_bucket_brigade *src,

Callers 2

h2_c2_filter_inFunction · 0.85
h2_c2_filter_request_inFunction · 0.85

Calls 1

fit_bucket_intoFunction · 0.85

Tested by

no test coverage detected