Bug 175072

Summary: cancelled download of file produced 200 ok log entry
Product: [Fedora] Fedora Reporter: Need Real Name <lsof>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-06 10:03:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2005-12-06 09:19:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050923 Epiphany/1.6.5

Description of problem:
I have a file called 1g on an apache server which is 1 gigabytes.

Using wget, I download the file, and cancel the download at 10%.

The apache access log (combined format) shows:
 192.168.x.x - - [06/Dec/2005:10:01:15 +0100] "GET /1g HTTP/1.1" 200 1073741824

Perhaps I've misunderstood things, but I was expecting a 206 partial content status in place of the 200 ok.

and again, perhaps I've misunderstood, but I was expecting the size of the data transferred to the client as the last field, rather than the size of the file on disk.

"The last entry indicates the size of the object returned to the client, not including the response headers."
 -- http://httpd.apache.org/docs/1.3/logs.html#common

Same with curl, as you would expect.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
x

Additional info:

Comment 1 Joe Orton 2005-12-06 09:26:14 UTC
You get a 206 only if the client requested a byte-ranged response.  See here:

http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#formats

for the difference between %O and %b.

Comment 2 Need Real Name 2005-12-06 09:37:18 UTC
Okay, so if the request was made, but never fulfilled, 200 is the correct code.
Got you. I didn't know that.

But your other point says to look at the difference between %b and %0.
The common log format uses %b, which is the "size of response in bytes". The
response size was 100 megabytes. The log says a gigabyte.

Comment 3 Need Real Name 2005-12-06 09:37:51 UTC
I didn't mean fulfilled, I meant "completed" for that first part.

Comment 4 Joe Orton 2005-12-06 10:03:36 UTC
The size of the HTTP response is 1Gb if you GET a 1Gb file.  The number of bytes
sent to the client is reflected by %b, per the docs URL:

""
Note that in httpd 2.0, unlike 1.3, the %b and %B format strings do not
represent the number of bytes sent to the client, but simply the size in bytes
of the HTTP response (which will differ, for instance, if the connection is
aborted, or if SSL is used). The %O format provided by mod_logio will log the
actual number of bytes sent over the network.
""

please don't reopen this bug, take up further discussion on
fedora-list if you have more questions.