Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 92187 invoked from network); 25 Apr 2008 17:05:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Apr 2008 17:05:04 -0000 Received: (qmail 99310 invoked by uid 500); 25 Apr 2008 17:05:00 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 99228 invoked by uid 500); 25 Apr 2008 17:05:00 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 99153 invoked by uid 99); 25 Apr 2008 17:05:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2008 10:05:00 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2008 17:04:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 07E1B1A9838; Fri, 25 Apr 2008 10:04:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r651652 - /apr/apr/branches/1.3.x/network_io/unix/sendrecv.c Date: Fri, 25 Apr 2008 17:04:27 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080425170428.07E1B1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Fri Apr 25 10:04:26 2008 New Revision: 651652 URL: http://svn.apache.org/viewvc?rev=651652&view=rev Log: Correct legacy crumbs from the new OS/X sendfile changes. Submitted by: Geoff Greer Backports: r651651 Modified: apr/apr/branches/1.3.x/network_io/unix/sendrecv.c Modified: apr/apr/branches/1.3.x/network_io/unix/sendrecv.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/network_io/unix/sendrecv.c?rev=651652&r1=651651&r2=651652&view=diff ============================================================================== --- apr/apr/branches/1.3.x/network_io/unix/sendrecv.c (original) +++ apr/apr/branches/1.3.x/network_io/unix/sendrecv.c Fri Apr 25 10:04:26 2008 @@ -410,7 +410,7 @@ apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { - apr_off_t nbytes = *len; + apr_off_t nbytes = 0; apr_off_t bytes_to_send = *len; apr_size_t header_bytes_written = 0; int rv; @@ -445,9 +445,6 @@ header_bytes_written = rv; rv = 0; } - else { - header_bytes_written = 0; - } } else if (bytes_to_send) { /* We won't dare call sendfile() if we don't have @@ -513,7 +510,7 @@ } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); - (*len) = nbytes; + (*len) = nbytes + header_bytes_written; if (rv == -1) { return errno; }