| 1171 | ******************************************************************************/ |
| 1172 | |
| 1173 | static 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 | |
| 1193 | apr_status_t h2_brigade_concat_length(apr_bucket_brigade *dest, |
| 1194 | apr_bucket_brigade *src, |
no outgoing calls
no test coverage detected