-1. Otherwise, we'll never use apr_sendfile().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86911
13f79535-47bb-0310-9956-
ffa450edef68
if (AP_BUCKET_IS_EOS(e) || AP_BUCKET_IS_FLUSH(e)) {
send_it = 1;
}
- rv = ap_bucket_read(e, &ignored, &length, AP_BLOCK_READ);
- if (rv != APR_SUCCESS) {
- return rv;
+ if (e->length == -1) { /* if length unknown */
+ rv = ap_bucket_read(e, &ignored, &length, AP_BLOCK_READ);
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
+ }
+ else {
+ length = e->length;
}
r->bytes_sent += length;
}