Discussion:
How to change the WinHttpReadData() read buffer?
(too old to reply)
DSPkid
2008-09-15 09:26:00 UTC
Permalink
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
2008-09-19 08:30:48 UTC
Permalink
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.
Post by DSPkid
Hi,
How to change the WinHttpReadData() read buffer?
The WinHttpSetOption() option flag WINHTTP_OPTION_READ_BUFFER_SIZE show as
below
"This option has been deprecated; it has no effect."
Thanks in advance.
DSPkid
2008-09-22 14:20:01 UTC
Permalink
Hi Janca,

Thanks and I agree with you.

DSPKid
Post by janca
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.
Post by DSPkid
Hi,
How to change the WinHttpReadData() read buffer?
The WinHttpSetOption() option flag WINHTTP_OPTION_READ_BUFFER_SIZE show as
below
"This option has been deprecated; it has no effect."
Thanks in advance.
Ari Pernick [MSFT]
2008-10-07 16:27:12 UTC
Permalink
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.
Post by DSPkid
Hi,
How to change the WinHttpReadData() read buffer?
The WinHttpSetOption() option flag WINHTTP_OPTION_READ_BUFFER_SIZE show as
below
"This option has been deprecated; it has no effect."
Thanks in advance.
Loading...