PUT request on IIS6 exceeding 4GB does not succeed
am 29.06.2007 10:31:47 von Oliver Tengler
Hi,
I'm implementing a HTTP client which uploads data using a plain PUT
request handled by the WebDav extension which ships with IIS6. WebDav is
the only web service extension which is enabled. Also no other ISAPI
filters are installed.
My client uploads data using a PUT request with chunked encoding. The
header "Transfer-Encoding" is set to "chunked".
This implementation works fine for files smaller 4GB but above it fails.
When testing with Apache 2.2 my upload code works flawlessly for files
larger than 4GB.
To rule out the HTTP library used being the source of the problem I've
implemented test code using WinHTTP and Python (which uses WinSocks).
The behavior is identical.
Also directory security is set to Anonymous and NTFS rights allow
everyone to write. No FAT32 is being used.
I transfer chunks of 0.5 GB. What happens if I cross 4GB depends on the
OS IIS6 is running on:
XP 64bit edition and Win2003 server SP2:
IIS stops writing to the file at 4.294.967.295 (which is 2^32-1).
My client code continues sending data until all data is sent. When
receiving the response I get a code 201 (created). But the file is
truncated.
Win2003 server SP1:
The file grows till 4GB then it is suddenly truncated to zero bytes.
After that it takes some time until my client gets the error "The
connection with the server was terminated abnormally" when it tries to
write data to the server.
Is this apparent limit to 4GB a limit of the WebDAV implementation of
MS? I read several times that IIS6 itself has no upload limitations. Is
it configurable?
Thanks for reading!
Best regards,
Oliver Tengler
Re: PUT request on IIS6 exceeding 4GB does not succeed
am 03.07.2007 11:32:34 von Egbert Nierop
"Oliver Tengler" schreef in bericht
news:%23aeuvfiuHHA.2028@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I'm implementing a HTTP client which uploads data using a plain PUT
> request handled by the WebDav extension which ships with IIS6. WebDav is
> the only web service extension which is enabled. Also no other ISAPI
> filters are installed.
>
> My client uploads data using a PUT request with chunked encoding. The
> header "Transfer-Encoding" is set to "chunked".
Here you got an answer from Wade A. Hilmo (MS)
....
ISAPI is limited to 4GB of content-length because the pECB->dwTotalBytes
member is only 32 bits. There is code (at least in IIS 6) that checks for
an overflow when the textual content-length header is mapped into that
member of the ECB. You are probably seeing a failure due to that overflow.
If you want to send more than 4GB in a request entity body, then you should
use chunked transfer encoding for the request. In this case, there is no
content-length header for IIS to map (and the dwTotalBytes member gets set
to 0xffffffff.)
....
> This implementation works fine for files smaller 4GB but above it fails.
> When testing with Apache 2.2 my upload code works flawlessly for files
> larger than 4GB.
>
> To rule out the HTTP library used being the source of the problem I've
> implemented test code using WinHTTP and Python (which uses WinSocks). The
> behavior is identical.
> Also directory security is set to Anonymous and NTFS rights allow everyone
> to write. No FAT32 is being used.
>
> I transfer chunks of 0.5 GB. What happens if I cross 4GB depends on the OS
> IIS6 is running on:
> XP 64bit edition and Win2003 server SP2:
> IIS stops writing to the file at 4.294.967.295 (which is 2^32-1).
> My client code continues sending data until all data is sent. When
> receiving the response I get a code 201 (created). But the file is
> truncated.
>
> Win2003 server SP1:
> The file grows till 4GB then it is suddenly truncated to zero bytes. After
> that it takes some time until my client gets the error "The connection
> with the server was terminated abnormally" when it tries to write data to
> the server.
>
> Is this apparent limit to 4GB a limit of the WebDAV implementation of MS?
> I read several times that IIS6 itself has no upload limitations. Is it
> configurable?
>
> Thanks for reading!
> Best regards,
> Oliver Tengler
Re: PUT request on IIS6 exceeding 4GB does not succeed
am 09.07.2007 16:20:39 von Oliver Tengler
Egbert Nierop (MVP for IIS) wrote:
>
> "Oliver Tengler" schreef in bericht
> news:%23aeuvfiuHHA.2028@TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> I'm implementing a HTTP client which uploads data using a plain PUT
>> request handled by the WebDav extension which ships with IIS6. WebDav
>> is the only web service extension which is enabled. Also no other
>> ISAPI filters are installed.
>>
>> My client uploads data using a PUT request with chunked encoding. The
>> header "Transfer-Encoding" is set to "chunked".
>
>
> Here you got an answer from Wade A. Hilmo (MS)
>
> ...
> ISAPI is limited to 4GB of content-length because the pECB->dwTotalBytes
> member is only 32 bits. There is code (at least in IIS 6) that checks for
> an overflow when the textual content-length header is mapped into that
> member of the ECB. You are probably seeing a failure due to that overflow.
>
> If you want to send more than 4GB in a request entity body, then you should
> use chunked transfer encoding for the request. In this case, there is no
> content-length header for IIS to map (and the dwTotalBytes member gets set
> to 0xffffffff.)
> ...
Thanks for the answer.
This is exactly what I am doing. I sent my request with chunked transfer
encoding. But even this doesn't help to exceed 4GB.
>
>> This implementation works fine for files smaller 4GB but above it
>> fails. When testing with Apache 2.2 my upload code works flawlessly
>> for files larger than 4GB.
>>
>> To rule out the HTTP library used being the source of the problem I've
>> implemented test code using WinHTTP and Python (which uses WinSocks).
>> The behavior is identical.
>> Also directory security is set to Anonymous and NTFS rights allow
>> everyone to write. No FAT32 is being used.
>>
>> I transfer chunks of 0.5 GB. What happens if I cross 4GB depends on
>> the OS IIS6 is running on:
>> XP 64bit edition and Win2003 server SP2:
>> IIS stops writing to the file at 4.294.967.295 (which is 2^32-1).
>> My client code continues sending data until all data is sent. When
>> receiving the response I get a code 201 (created). But the file is
>> truncated.
>>
>> Win2003 server SP1:
>> The file grows till 4GB then it is suddenly truncated to zero bytes.
>> After that it takes some time until my client gets the error "The
>> connection with the server was terminated abnormally" when it tries to
>> write data to the server.
>>
>> Is this apparent limit to 4GB a limit of the WebDAV implementation of
>> MS? I read several times that IIS6 itself has no upload limitations.
>> Is it configurable?
>>
>> Thanks for reading!
>> Best regards,
>> Oliver Tengler
>