Commit 085ce269 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Drain content before reusing connection in open_http_connection.

parent 59395d88
......@@ -4745,22 +4745,22 @@ static DWORD open_http_connection(http_request_t *request, BOOL *reusing)
netconn_t *netconn = NULL;
DWORD res;
reset_data_stream(request);
if (request->netconn)
{
if (is_valid_netconn(request->netconn) && NETCON_is_alive(request->netconn))
if (NETCON_is_alive(request->netconn) && drain_content(request, TRUE) == ERROR_SUCCESS)
{
reset_data_stream(request);
*reusing = TRUE;
return ERROR_SUCCESS;
}
else
{
free_netconn(request->netconn);
request->netconn = NULL;
}
TRACE("freeing netconn\n");
free_netconn(request->netconn);
request->netconn = NULL;
}
reset_data_stream(request);
res = HTTP_ResolveName(request);
if(res != ERROR_SUCCESS)
return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment