Bug 36692

Summary: Download file: 255 bytes length passed; 256 bytes - empty body answer.
Product: Apache httpd-2 Reporter: Dmitry <dmitrysp>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED INVALID    
Severity: blocker    
Priority: P2    
Version: 2.0.54   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Dmitry 2005-09-16 22:21:21 UTC
I have some file with 255 bytes length:
-------
01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
0123456789012345
-------

In telnet: 

GET /test.html HTTP/1.0
Host: localhost

<<<begin here<<<HTTP/1.1 200 OK
Date: Fri, 16 Sep 2005 20:02:10 GMT
Server: Apache/2.0.54 (Win32) PHP/5.1.0RC1
Last-Modified: Fri, 16 Sep 2005 20:02:09 GMT
ETag: W/"23cd4-ff-1197815e"
Accept-Ranges: bytes
Content-Length: 255
Connection: close
Content-Type: text/html

01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789
0123456789012345678901234567890123456789012345678901234
>>>end here>>>

It's ok. Now i add new byte 'X' to file:
-----------
01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789
012345678901234X
-----------

Open telnet:

GET /test.html HTTP/1.0
Host: localhost

<<<-begin here-<<<HTTP/1.1 200 OK
Date: Fri, 16 Sep 2005 20:03:28 GMT
Server: Apache/2.0.54 (Win32) PHP/5.1.0RC1
Last-Modified: Fri, 16 Sep 2005 20:03:26 GMT
ETag: "23cd4-100-1633f1b6"
Accept-Ranges: bytes
Content-Length: 256
Connection: close
Content-Type: text/html

>>>-end here->>>

Empty body document. It's normal?

Statistic:
0-255 bytes -- full answer
256-5576 bytes -- empty answer
5577 bytes and more -- full answer and etc...

Tested in 2.0.53 and 2.0.54, WinXP sp2.
Comment 2 Dmitry 2005-09-17 15:12:02 UTC
>EnableSendfile Off
>EnableMMAP Off
>Win32DisableAcceptEx

Very good, worked, thank you!

This options fixed and second bug on my Apache 2.0.53/54:
1. Copy rar.exe to c:\www_root\rar.exe
2. Run <<wget -d "http://localhost/rar.exe">> and save file to c:\download\rar.
exe
3. Compare this two files - run <<fc /b c:\download\rar.exe c:\www_root\rar.
exe>>
00010000: 4D 00
00010001: 5A 00
00010002: 50 E8
00010003: 00 6D
00010004: 02 1C
00010005: 00 FF
00010006: 00 FF
....
.... skip block: all bytes is erroneous
.... 
000116CB: 50 00
000116CC: 01 E8
000116CD: 48 A7
000116CE: 3B 8D
000116CF: D8 FF (Next 000116D0-00019999 - all bytes correct)
00020000: 4D 85
00020001: 5A B8
00020002: 50 F0
00020003: 00 FE
00020004: 02 FF
....
.... skip block: all bytes is erroneous
.... 
000216C8: 8A E8
000216C9: 10 99
000216CA: 88 01
000216CB: 50 00
000216CC: 01 83
000216CD: 48 C4
000216CE: 3B 10
000216CF: D8 8B
00030000: 4D 00
00030001: 5A 00
00030002: 50 8B
00030003: 00 93
00030004: 02 44
00030005: 00 06
00030008: 04 8B
00030009: 00 4A
0003000A: 0F 08
....
and etc whis period in 0x16CF (5839) bytes in first each 64Kb data block. Real 
bytes in first of 64Kb-block replaced to "4d 5a 50 00 02 00 00 ..." (it's are 
first bytes in rar.exe).