Forum Moderators: DixonJones

Message Too Old, No Replies

Apache HTTP status code logging

Status code logging

         

masteve00

12:06 am on Aug 4, 2005 (gmt 0)

10+ Year Member



How does Apache decide when to use status code 200 and 206? I am getting the followings on my log file:

203.#*$!.xxx.xxx - - [14/Jul/2005:00:45:09 +0000] "GET /ViewerSetup.exe HTTP/1.0" 200 5401264 272 "http://www.yyy.com/item?id=3023925&GP=IL13872" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" GET /ViewerSetup.exe "HTTP/1.0" User=YZ198941121301556tbcrmb
68.xxx.xxx.xxx - - [14/Jul/2005:00:46:02 +0000] "GET /ViewerSetup.exe HTTP/1.1" 200 6297728 31 "http://www.yyy.com?id=3023925&GP=IL13872" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" GET /ViewerSetup.exe "HTTP/1.1" User=YZ1469101121301821tepkxa
209.xxx.xxx.xxx- - [14/Jul/2005:00:57:40 +0000] "GET /ViewerSetup.exe HTTP/1.0" 200 125640 38 "http://www.yyy.com?id3023925&GP=IL13872" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" GET /ViewerSetup.exe "HTTP/1.0" User=YZ6612191091831464nhfyye
202.xxx.xxx.xxx - - [14/Jul/2005:04:22:32 +0000] "GET /ViewerSetup.exe HTTP/1.0" 206 172032 45 "http://www.yyy.com?id=3023925&GP=IL13872" "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)" GET /ViewerSetup.exe "HTTP/1.0" User=YZ9071841121314644tepvzb

6297728 is the correct size for the file. I can see the 4th line makes sense. But why Apache is assigning status code 200 when the download size is less than the actualy file size?

[edited by: jatar_k at 7:08 am (utc) on Aug. 4, 2005]
[edit reason] removed specific ips [/edit]

Dijkgraaf

12:23 am on Aug 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See [w3.org...]

10.2.7 206 Partial Content

The server has fulfilled the partial GET request for the resource. The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional.

masteve00

12:37 am on Aug 4, 2005 (gmt 0)

10+ Year Member



Thanks for the reply. I did a lot of research before posting to this site. I also visited [w3.org...]

I guess my question is why apache is logging status code 200 when the file size is less than 6297728?

It makes total sense if apache logs it as 206 instead of 200.

ronburk

9:14 pm on Aug 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess my question is why apache is logging status code 200 when the file size is less than 6297728?

Well, the accurate answer can be found by examining the source code if it's important enough to you (probably not). It's easy to speculate, however.

There was no 206 result code defined in HTTP 1.0 [w3.org] (note which of your GETs were via 1.0 instead of 1.1). Therefore, for things like broken connections, it would be logical for Apache to report 200 for an HTTP 1.0 client. That leaves the more interesting question of when/why Apache would report a 206 code for an HTTP 1.0 client.

Now, what should Apache do if a client claims to be HTTP 1.0, but goes ahead and includes an HTTP 1.1 style range request? It's at least plausible that Apache would go ahead and satisfy the request with a 206 status code (though I have not dug in the source code to see whether this is true or not). If it's really important, you could figure it out, or else carry the question to a more technical forum devoted to Apache.