You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/12/26 04:29:35 UTC

[PATCH] PR#1366: fix result of send_fd_length

send_fd_length calculates the total_bytes_sent incorrectly.  I already
fixed this bug in send_mmap, but I guess I forgot to deal with
send_fd_length.  Here's a patch to fix it. 

Dean

Index: main/http_protocol.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_protocol.c,v
retrieving revision 1.171
diff -u -r1.171 http_protocol.c
--- http_protocol.c	1997/12/21 08:18:16	1.171
+++ http_protocol.c	1997/12/26 03:25:12
@@ -1638,12 +1638,12 @@
             break;
         }
         o = 0;
-        total_bytes_sent += n;
 
         while (n && !r->connection->aborted) {
             w = bwrite(r->connection->client, &buf[o], n);
             if (w > 0) {
                 reset_timeout(r);   /* reset timeout after successful write */
+		total_bytes_sent += w;
                 n -= w;
                 o += w;
             }



Re: [PATCH] PR#1366: fix result of send_fd_length

Posted by Dirk-Willem van Gulik <Di...@jrc.it>.
+1, tried it and fixes one of my mistries with an md5 and the
cache. Nice catch.

DW.

On Thu, 25 Dec 1997, Dean Gaudet wrote: 

> send_fd_length calculates the total_bytes_sent incorrectly.  I already
> fixed this bug in send_mmap, but I guess I forgot to deal with
> send_fd_length.  Here's a patch to fix it. 
> 
> Dean
> 
> Index: main/http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/main/http_protocol.c,v
> retrieving revision 1.171
> diff -u -r1.171 http_protocol.c
> --- http_protocol.c	1997/12/21 08:18:16	1.171
> +++ http_protocol.c	1997/12/26 03:25:12
> @@ -1638,12 +1638,12 @@
>              break;
>          }
>          o = 0;
> -        total_bytes_sent += n;
>  
>          while (n && !r->connection->aborted) {
>              w = bwrite(r->connection->client, &buf[o], n);
>              if (w > 0) {
>                  reset_timeout(r);   /* reset timeout after successful write */
> +		total_bytes_sent += w;
>                  n -= w;
>                  o += w;
>              }
> 
> 
> 

http://cils.ceo.org                         http://enrm.ceo.org
dirkx@technologist.com                     Dirk.vanGulik@jrc.it
+39 332 78 0014       +39 332 78 9549       fax +39 332 78 9185
ISEI/ESBA;                     The Center For Earth Observation
Joint Research Centre of the European Communities, Ispra, Italy