Commit 70f2f5d6 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Close the network connection if necessary.

parent 5c1c923d
......@@ -1225,7 +1225,21 @@ static BOOL receive_data_chunked( request_t *request, void *buffer, DWORD size,
static void finished_reading( request_t *request )
{
/* FIXME: close connection here if necessary */
static const WCHAR closeW[] = {'c','l','o','s','e',0};
BOOL close = FALSE;
WCHAR connection[20];
DWORD size = sizeof(connection);
if (request->hdr.disable_flags & WINHTTP_DISABLE_KEEP_ALIVE) close = TRUE;
else if (query_headers( request, WINHTTP_QUERY_CONNECTION, NULL, connection, &size, NULL ) ||
query_headers( request, WINHTTP_QUERY_PROXY_CONNECTION, NULL, connection, &size, NULL ))
{
if (!strcmpiW( connection, closeW )) close = TRUE;
}
else if (!strcmpW( request->version, http1_0 )) close = TRUE;
if (close) close_connection( request );
request->content_length = ~0UL;
request->content_read = 0;
}
......
......@@ -39,6 +39,7 @@
static const WCHAR getW[] = {'G','E','T',0};
static const WCHAR postW[] = {'P','O','S','T',0};
static const WCHAR slashW[] = {'/',0};
static const WCHAR http1_0[] = {'H','T','T','P','/','1','.','0',0};
static const WCHAR http1_1[] = {'H','T','T','P','/','1','.','1',0};
typedef struct _object_header_t object_header_t;
......
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