MSDN示例代码与文本

问题描述:





页面
https://msdn.microsoft.com/en-us/library/windows/desktop/aa384101%28v=vs.85%29.aspx
包含警告,反对依赖WinHttpQueryDataAvailable的返回值(" 重要 不要使用WinHttpQueryDataAvailable
的返回值来判断是否结束已达到响应,因为并非所有服务器都正确终止响应,并且不正确的终止响应会导致WinHttpQueryDataAvailable预期更多数据"。"。


但是,示例代码在相同的页面就是这样,循环直到WinHttpQueryDataAvailable说没有更多的数据可用。我们如何确定服务器上没有更多字节?

Hi,

The page https://msdn.microsoft.com/en-us/library/windows/desktop/aa384101%28v=vs.85%29.aspx contains the warning against relying on the return value of WinHttpQueryDataAvailable ("Important Do not use the return value of WinHttpQueryDataAvailable to determine whether the end of a response has been reached, because not all servers terminate responses properly, and an improperly terminated response causes WinHttpQueryDataAvailable to anticipate more data").

However, the sample code on the same page does just that, looping until WinHttpQueryDataAvailable says there's no more data available. How are we supposed to determine there's no more bytes coming from the server?

BR,

你在哪里看到它"循环直到WinHttpQueryDataAvailable说没有更多数据可用"?我看到它循环直到dwSize< = 0。
Where do you see it "looping until WinHttpQueryDataAvailable says there's no more data available"? I see it looping until dwSize <= 0.