Commit e74514b1 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

wininet: Assume that if we're connected to an HTTP/1.1 server then connections…

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.
parent 0b168e66
...@@ -3864,17 +3864,26 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v ...@@ -3864,17 +3864,26 @@ 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");
/* 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) ||
strcmpiW(szVersion, g_szHttp1_1))
{
WCHAR szConnectionResponse[20];
dwBufferSize = sizeof(szConnectionResponse);
if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse,
&dwBufferSize, NULL) || &dwBufferSize, NULL) ||
strcmpiW(szConnectionResponse, szKeepAlive)) strcmpiW(szConnectionResponse, szKeepAlive))
{ {
HTTPREQ_CloseConnection(&lpwhr->hdr); HTTPREQ_CloseConnection(&lpwhr->hdr);
} }
}
/* FIXME: store data in the URL cache here */ /* FIXME: store data in the URL cache here */
......
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