Commit 12e6c14e authored by Ričardas Barkauskas's avatar Ričardas Barkauskas Committed by Alexandre Julliard

wininet: Move handling of existing request connections to open_http_connection.

parent 992c2bd3
......@@ -4786,9 +4786,22 @@ static DWORD open_http_connection(http_request_t *request, BOOL *reusing)
netconn_t *netconn = NULL;
DWORD res;
assert(!request->netconn);
reset_data_stream(request);
if (request->netconn)
{
if (NETCON_is_alive(request->netconn))
{
*reusing = TRUE;
return ERROR_SUCCESS;
}
else
{
free_netconn(request->netconn);
request->netconn = NULL;
}
}
res = HTTP_ResolveName(request);
if(res != ERROR_SUCCESS)
return res;
......@@ -4936,20 +4949,6 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
loop_next = FALSE;
if (request->netconn)
{
if (!NETCON_is_alive(request->netconn))
{
free_netconn(request->netconn);
request->netconn = NULL;
}
else
{
reset_data_stream(request);
}
}
reusing_connection = request->netconn != NULL;
if(redirected) {
request->contentLength = ~0u;
request->bytesToWrite = 0;
......@@ -4984,7 +4983,8 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
TRACE("Request header -> %s\n", debugstr_w(requestString) );
if (!reusing_connection && (res = open_http_connection(request, &reusing_connection)) != ERROR_SUCCESS)
res = open_http_connection(request, &reusing_connection);
if (res != ERROR_SUCCESS)
break;
/* send the request as ASCII, tack on the optional data */
......
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