From: Jeff Trawick Date: Tue, 31 Oct 2000 19:59:09 +0000 (+0000) Subject: a couple of fixes for byte ranges: X-Git-Tag: APACHE_2_0_ALPHA_8~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ccd0d2605827f076f4f72a9593802d58f2e151c;p=apache a couple of fixes for byte ranges: . use %qx format instead of %llx for 64-bit integer (apr_time_t); %llx prints as "%llx" . pass offset and length to ap_bucket_create_mmap() so that byte ranges work with mmaps (at least for a single range) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86777 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 65b7d38457..c3dd52a7fe 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -311,7 +311,7 @@ AP_DECLARE(int) ap_set_byterange(request_rec *r) long tlength = 0; r->byterange = 2; - r->boundary = apr_psprintf(r->pool, "%llx%lx", + r->boundary = apr_psprintf(r->pool, "%qx%lx", r->request_time, (long) getpid()); while (internal_byterange(0, &tlength, r, &r_range, NULL, NULL)); apr_table_setn(r->headers_out, "Content-Length", @@ -2820,12 +2820,8 @@ AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, ap_bucket_brigade *bb = NULL; ap_bucket *b; - /* WE probably need to do something to make sure we are respecting the - * offset and length. I think I know how to do this, but I will wait - * until after the commit to actually write the code. - */ bb = ap_brigade_create(r->pool); - b = ap_bucket_create_mmap(mm, 0, mm->size); + b = ap_bucket_create_mmap(mm, offset, length); AP_BRIGADE_INSERT_TAIL(bb, b); ap_pass_brigade(r->output_filters, bb);