You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Anthony Howe <ac...@snert.com> on 2000/11/14 15:17:09 UTC

mod_proxy/6841: mod_proxy does not maintain the request_rec->bytes_sent field.

>Number:         6841
>Category:       mod_proxy
>Synopsis:       mod_proxy does not maintain the request_rec->bytes_sent field.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Nov 14 06:20:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     achowe@snert.com
>Release:        1.3.14
>Organization:
apache
>Environment:
Linux mail.snert.net 2.0.34C52_SK #1 Tue Nov 30 18:14:40 PST 1999 mips unknown
>Description:
A user reported a bug against mod_throttle claiming that mod_throttle failed to 
record the number of bytes sent when the request passed through mod_proxy.
Apon debugging and examination of the mod_proxy source, I found that
ap_proxy_send_fb() tracked and returned the number of bytes received/sent,
but that NO ONE made use of the return value to update the request_rec's
bytes_sent field.

Find enclosed a one line change to src/modules/proxy/proxy_util.c that updates
the request_rec.

By making the change in ap_proxy_send_fb(), http and ftp response from the
remote server or from the cache will all correctly update the request_rec
so that other modules can make use of this information in the logging phase.

>How-To-Repeat:

>Fix:
*** proxy_util.c.orig	Tue Nov 14 14:34:42 2000
--- proxy_util.c	Tue Nov 14 14:49:25 2000
***************
*** 618,623 ****
--- 618,626 ----
  	ap_bflush(con->client);
  
      ap_kill_timeout(r);
+ 
+ 	r->bytes_sent += total_bytes_rcvd;
+ 
      return total_bytes_rcvd;
  }
  
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]