wininet: Assume that if we're connected to an HTTP/1.1 server then connections can be kept alive by default.

So don't close the connection in this case in HTTP_FinishedReading.
This commit is contained in:
Rob Shearman 2008-03-14 18:10:08 +00:00 committed by Alexandre Julliard
parent 0b168e66f6
commit e74514b138
1 changed files with 14 additions and 5 deletions

View File

@ -3864,16 +3864,25 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v
*/ */
BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr)
{ {
WCHAR szConnectionResponse[20]; WCHAR szVersion[10];
DWORD dwBufferSize = sizeof(szConnectionResponse); DWORD dwBufferSize = sizeof(szVersion);
TRACE("\n"); TRACE("\n");
if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, /* as per RFC 2068, S8.1.2.1, if the client is HTTP/1.1 then assume that
* the connection is keep-alive by default */
if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_VERSION, szVersion,
&dwBufferSize, NULL) || &dwBufferSize, NULL) ||
strcmpiW(szConnectionResponse, szKeepAlive)) strcmpiW(szVersion, g_szHttp1_1))
{ {
HTTPREQ_CloseConnection(&lpwhr->hdr); WCHAR szConnectionResponse[20];
dwBufferSize = sizeof(szConnectionResponse);
if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse,
&dwBufferSize, NULL) ||
strcmpiW(szConnectionResponse, szKeepAlive))
{
HTTPREQ_CloseConnection(&lpwhr->hdr);
}
} }
/* FIXME: store data in the URL cache here */ /* FIXME: store data in the URL cache here */