WinHttpQueryDataAvailable

WinHttpQueryDataAvailable

本文介绍了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,

推荐答案


这篇关于MSDN示例代码与文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 21:34