Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 56445 invoked by uid 500); 24 Jul 2002 17:01:39 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Delivered-To: moderator for dev@apr.apache.org Received: (qmail 50755 invoked from network); 24 Jul 2002 16:58:33 -0000 Date: Wed, 24 Jul 2002 09:58:29 -0700 (PDT) From: Shantonu Sen To: Wilfredo Sanchez cc: Apache Portable Runtime Developers , Apache HTTPD Developers Subject: Re: atol In-Reply-To: <06338C0A-9F14-11D6-B55A-003065F8924C@apache.org> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Wed, 24 Jul 2002, Wilfredo Sanchez wrote: > There are several places in HTTPD where we use atol to parse ranges > from HTTP headers. Problem (at least on Darwin) is that a long is > smaller than size_t, and we're unable to handle large files in the 2-4GB > range. Also smaller than an off_t (for platforms where it's a 64-bit quantity and a long isn't), which is the issue the patches directly address. For platforms where an off_t is a 32-bit quantity, or a long is a 64-bit quantity, or both, the compiler will do the right thing in assigning a 64-bit rval to a 32-bit lval, which is better than the currect situation of a 32-bit rval to a 64-bit lval (for those platforms with support it). Supporting HEAD requests even of files >4GB seems to have another problem where the file size is being reported as 2^31 (I know, that's out of bounds for a signed 32-bit number, so something else is afoot), which is why the patches don't unlock serving of larger files with HTTP/1.1 partial ranges. > It uses strtoll is available, otherwise falls back to > strtol. I did not feel comfortable pulling over the strtoll(3) implementation from Darwin or FreeBSD (they are the same) without doing more investigation about how portable *their* implementation is. I've verified that strtoll(3) exists at least on Darwin 5.5, Darwin 6.0 (aka Mac OS X 10.2 "Jaguar"), FreeBSD 4.6, and Solaris 8, which seems like a broad enough cross section of operating systems to make the "use it if you got it" approach reasonable. Shantonu Sen Apple Computer, Inc.