I'm using WinHTTP to send data to a web server script and in some cases I need the server to kill the incoming data (as it is not required) but still return a response to the client app. I'm using stream_socket_shutdown(STREAM_SHUT_RD)
from the server end to end the incoming data, then sending a response back as normal. The problem lies with WinHTTP, I get a negative response back from WinHttpWriteData()
as expected and stop sending data but when I call WinHttpReceiveResponse()
it returns false and GetLastError()
returns ERROR_WINHTTP_CONNECTION_ERROR
.
Is there a way to perhaps reset the internal error condition for WinHTTP? Or another way to receive the response after the connection has been broken by the server?
Thanks, J