bytes_handled += len;
}
- /* We no longer need the returned brigade. */
- apr_brigade_destroy(b);
-
/* We likely aborted early before reading anything or we read no
* data. Technically, this might be success condition. But,
* probably means something is horribly wrong. For now, we'll
*/
if (bytes_handled == 0) {
*read = 0;
+ apr_brigade_destroy(b);
return APR_SUCCESS;
}
rv = ap_rgetline(&tmp, next_size, &next_len, r, fold);
if (rv != APR_SUCCESS) {
+ apr_brigade_destroy(b);
return rv;
}
last_char = *s + bytes_handled - 1;
}
else {
+ apr_brigade_destroy(b);
return APR_ENOSPC;
}
}
APR_BLOCK_READ, 1);
if (rv != APR_SUCCESS) {
+ apr_brigade_destroy(b);
return rv;
}
/* If we see an EOS, don't bother doing anything more. */
if (APR_BUCKET_IS_EOS(e)) {
*read = bytes_handled;
+ apr_brigade_destroy(b);
return APR_SUCCESS;
}
rv = apr_bucket_read(e, &str, &len, APR_BLOCK_READ);
if (rv != APR_SUCCESS) {
+ apr_brigade_destroy(b);
return rv;
}
rv = ap_rgetline(&tmp, next_size, &next_len, r, fold);
if (rv != APR_SUCCESS) {
+ apr_brigade_destroy(b);
return rv;
}
}
*read = bytes_handled + next_len;
+ apr_brigade_destroy(b);
return APR_SUCCESS;
}
else {
+ apr_brigade_destroy(b);
return APR_ENOSPC;
}
}
/* FIXME: Can we optimize this at all by placing it a different layer? */
ap_xlate_proto_from_ascii(*s, bytes_handled);
*read = bytes_handled;
+ apr_brigade_destroy(b);
return APR_SUCCESS;
}