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

Function fit_bucket_into

modules/http2/h2_util.c:1173–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171 ******************************************************************************/
1172
1173static void fit_bucket_into(apr_bucket *b, apr_off_t *plen)
1174{
1175 /* signed apr_off_t is at least as large as unsigned apr_size_t.
1176 * Problems may arise when they are both the same size. Then
1177 * the bucket length *may* be larger than a value we can hold
1178 * in apr_off_t. Before casting b->length to apr_off_t we must
1179 * check the limitations.
1180 * After we resized the bucket, it is safe to cast and substract.
1181 */
1182 if ((sizeof(apr_off_t) == sizeof(apr_int64_t)
1183 && b->length > APR_INT64_MAX)
1184 || (sizeof(apr_off_t) == sizeof(apr_int32_t)
1185 && b->length > APR_INT32_MAX)
1186 || *plen < (apr_off_t)b->length) {
1187 /* bucket is longer the *plen */
1188 apr_bucket_split(b, *plen);
1189 }
1190 *plen -= (apr_off_t)b->length;
1191}
1192
1193apr_status_t h2_brigade_concat_length(apr_bucket_brigade *dest,
1194 apr_bucket_brigade *src,

Callers 3

h2_brigade_concat_lengthFunction · 0.85
h2_brigade_copy_lengthFunction · 0.85
h2_append_brigadeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected