Commit ff97d397 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winhttp: Do not cache connection if suggested by request headers.

parent 11b8243f
......@@ -1922,7 +1922,7 @@ static DWORD refill_buffer( struct request *request, BOOL notify )
static void finished_reading( struct request *request )
{
BOOL close = FALSE, notify;
BOOL close = FALSE, close_request_headers;
WCHAR connection[20];
DWORD size = sizeof(connection);
......@@ -1937,18 +1937,16 @@ static void finished_reading( struct request *request )
}
else if (!wcscmp( request->version, L"HTTP/1.0" )) close = TRUE;
if (close)
size = sizeof(connection);
close_request_headers =
(!query_headers( request, WINHTTP_QUERY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, NULL, connection, &size, NULL )
|| !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, NULL, connection, &size, NULL ))
&& !wcsicmp( connection, L"close" );
if (close || close_request_headers)
{
size = sizeof(connection);
notify = (!query_headers( request, WINHTTP_QUERY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS,
NULL, connection, &size, NULL )
|| !query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION | WINHTTP_QUERY_FLAG_REQUEST_HEADERS,
NULL, connection, &size, NULL ))
&& !wcsicmp( connection, L"close" );
if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 0 );
if (close_request_headers) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 0 );
netconn_release( request->netconn );
if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 0 );
if (close_request_headers) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 0 );
}
else
cache_connection( request->netconn );
......
......@@ -2591,7 +2591,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
ok(!!strstr(buffer, "GET /cached"), "request not found.\n");
send(c, okmsg_length0, sizeof okmsg_length0 - 1, 0);
r = server_receive_request(c, buffer, sizeof(buffer));
todo_wine ok(!r, "got %d, buffer[0] %d.\n", r, buffer[0]);
ok(!r, "got %d, buffer[0] %d.\n", r, buffer[0]);
}
if (strstr(buffer, "GET /notcached"))
{
......
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