From 085ce269b13978f081b5dd7b70cd898a9e87fe0f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 17 Aug 2017 19:09:59 +0200 Subject: [PATCH] wininet: Drain content before reusing connection in open_http_connection. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/wininet/http.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index d6fdedd8001..dc106d80f18 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -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;