Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to change the WinHttpReadData() read buffer?

354 views
Skip to first unread message

DSPkid

unread,
Sep 15, 2008, 5:26:00 AM9/15/08
to
Hi,
How to change the WinHttpReadData() read buffer?

From MSDN :
The WinHttpSetOption() option flag WINHTTP_OPTION_READ_BUFFER_SIZE show as
below
"This option has been deprecated; it has no effect."

Thanks in advance.

janca

unread,
Sep 19, 2008, 4:30:48 AM9/19/08
to
Hi,

I'm sad to see no life on this list, I miss the official answers much,
and this reply is not one of those, either.
It is not clear to me what your question is about - as per my belief,
the data received via HTTP is first put into an internal buffer, and
the call to WinHttpReadData copies it from that buffer to a user
specified one.

If you meant the internal data buffer size, which we never 'meet' -
except via performance - I think that value cannot be changed. I hate
the question "why would one want to change it?", but seems to be
appropriate now. In fact, an optimal buffer size depends on many
things, l'd assume it involves the memory page size the OS uses, and I
believe there can be more to this than one could ever care of. Leaving
the choice of internal buffer size to the WinHTTP guys (do they still
exist at all?) might be the best to keep that value maintained to
follow OS changes and other internal stuff. I guess...

Otherwise, in case of WinHttpReadData(), the size of the buffer
finally receiving the result (not the internal, which receives it
first) data can vary from call to call, and works as I suppose you
know.

DSPkid

unread,
Sep 22, 2008, 10:20:01 AM9/22/08
to
Hi Janca,

Thanks and I agree with you.

DSPKid

Pernick [MSFT]@discussions.microsoft.com Ari Pernick [MSFT]

unread,
Oct 7, 2008, 12:27:12 PM10/7/08
to
From a quick look at the Vista code, the buffer given to WinHttpReadData is
passed directly to WinSock, so long as the caller isn't calling the
QueryDataAvailable API. The first call to ReadData probably gets some portion
of the buffer satisfied out of the internal Buffer used to read headers.

--Ari

This posting is provided "AS IS" with no warranties, and confers no rights.

0 new messages