Discussion:
transfer-encoding: chunked
(too old to reply)
koroppo
2008-08-18 10:50:01 UTC
Permalink
Hi:
I have follow the "how to enable chunked transfer encoding with IIS
("http://support.microsoft.com/kb/278998).
I am not sure if all the webpages of IIS will be sent in chunked after my
setting .
Does "chunked" a feather of web server?


If so, is it possible for me to use:
HttpQueryInfo(hRequest,HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER,(LPVOID)&dwContentLen, &dwBufLen,NULL);
to get the content length?

Also, I always get an error 12150 after using:
DWORD dwTransferEncoding = 100;
LPVOID lpTransferEncodingBuffer = new wchar_t[100];

HttpQueryInfo(hRequest,HTTP_QUERY_TRANSFER_ENCODING,(LPVOID)&lpTransferEncodingBuffer,&dwTransferEncoding,NULL);
swprintf_s(DebugBuffer, _T("transfer encoding, error:%d\n"),
GetLastError());
OutputDebugString(DebugBuffer);

error 12150 means: The requested header could not be located and I have no
idea at all.

Could anyone here be kind to help me?
how can I detect whether the webpage will be sent chunked or not?
A sample will help me a lot.

thanks in advance!
Ari Pernick [MSFT]
2008-10-07 16:41:01 UTC
Permalink
HttpQueryInfo is a WinInet API, not a WinHTTP API.
For both, the recieve side application of chunked encoding is invisible to
you unless you specifically try to discover the signalling header or attempt
to get the Content Length. You just keep asking for more entity body until
the Read Api tells you there is no more left.

--Ari

This posting is provided "AS IS" with no warranties, and confers no rights.
Post by koroppo
I have follow the "how to enable chunked transfer encoding with IIS
("http://support.microsoft.com/kb/278998).
I am not sure if all the webpages of IIS will be sent in chunked after my
setting .
Does "chunked" a feather of web server?
HttpQueryInfo(hRequest,HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER,(LPVOID)&dwContentLen, &dwBufLen,NULL);
to get the content length?
DWORD dwTransferEncoding = 100;
LPVOID lpTransferEncodingBuffer = new wchar_t[100];
HttpQueryInfo(hRequest,HTTP_QUERY_TRANSFER_ENCODING,(LPVOID)&lpTransferEncodingBuffer,&dwTransferEncoding,NULL);
swprintf_s(DebugBuffer, _T("transfer encoding, error:%d\n"),
GetLastError());
OutputDebugString(DebugBuffer);
error 12150 means: The requested header could not be located and I have no
idea at all.
Could anyone here be kind to help me?
how can I detect whether the webpage will be sent chunked or not?
A sample will help me a lot.
thanks in advance!
Loading...