InternetQueryDataAvailable返回ERROR_IO_PENDING后,WinInet请求失败并显示ERROR_EA_FILE_CORRUPT

时间:2014-04-03 11:17:31

标签: windows winapi visual-c++ network-programming wininet

我使用异步WinInet请求从服务器读取HTTPS数据。

我的情景用几句话说:

  1. 使用InternetUrlOpen创建请求(返回null)
  2. 等等 INTERNET_STATUS_HANDLE_CREATED通知,存储句柄
  3. 等待INTERNET_STATUS_REQUEST_COMPLETE
  4. 使用存储的句柄
  5. 调用InternetQueryDataAvailable以了解要读取的数据量
  6. 使用存储的句柄通过InternetReadFile读取数据,然后转到上一步
  7. 如果InternetQueryDataAvailable返回 ERROR_IO_PENDING,然后等待下一个INTERNET_STATUS_REQUEST_COMPLETE
  8. 但在InternetQueryDataAvailable返回ERROR_IO_PENDING后,我收到INTERNET_STATUS_REQUEST_COMPLETE dwError=276,即ERROR_EA_FILE_CORRUPT。之后我没有收到任何关于请求的通知,所以看起来请求确实失败了。

    这意味着什么?


    以下是一些日志:

    ...
    CRequestImpl::InternetStatusCallback: Handle 0x00CC0010 created
    CRequestImpl::InternetStatusCallback: Status: Detecting Proxy
    CRequestImpl::InternetStatusCallback: Status: Cookie found and will be sent with request
    CRequestImpl::InternetStatusCallback: Status: Sending request
    CRequestImpl::InternetStatusCallback: Status: Request sent (1098 Bytes)
    CRequestImpl::InternetStatusCallback: Status: Receiving Response
    CRequestImpl::InternetStatusCallback: Status: Response Received (519 Bytes)
    
    CRequestImpl::InternetStatusCallback: Status: Request complete, result=cc0010, err=0
    CRequestImpl::onRequestComplete: error=0
    CRequestImpl::onRequestComplete: internet data available, 276 bytes
    CRequestImpl::onRequestComplete: read 276 bytes
    CRequestImpl::InternetStatusCallback: Status: Receiving Response
    CRequestImpl::InternetStatusCallback: Status: Response Received (1756 Bytes)
    CRequestImpl::onRequestComplete: internet data available, 1679 bytes
    CRequestImpl::onRequestComplete: read 1679 bytes
    ...
    CRequestImpl::InternetStatusCallback: Status: Receiving Response
    CRequestImpl::InternetStatusCallback: Status: Response Received (7 Bytes)
    CRequestImpl::onRequestComplete: internet data available, 2 bytes
    CRequestImpl::onRequestComplete: read 2 bytes
    CRequestImpl::InternetStatusCallback: Status: Receiving Response
    CRequestImpl::onRequestComplete: InternetQueryDataAvailable failed with error 997: Overlapped I/O operation is in progress.
    
    CRequestImpl::InternetStatusCallback: Status: Response Received (283 Bytes)
    CRequestImpl::InternetStatusCallback: Status: Request complete, result=1, err=276
    CRequestImpl::onRequestComplete: error=276
    CRequestImpl::onRequestComplete: Internet request failed with error 276: The extended attribute file on the mounted file system is corrupt.
    

0 个答案:

没有答案