[PATCH v3] wininet: Reset context length for http status 304

Hans Leidekker hans at codeweavers.com
Wed Sep 29 05:48:38 CDT 2021


On Wed, 2021-09-29 at 19:17 +1000, Alistair Leslie-Hughes wrote:
> diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
> index e9363208471..b2862ead789 100644
> --- a/dlls/wininet/http.c
> +++ b/dlls/wininet/http.c
> @@ -2918,7 +2918,10 @@ static DWORD set_content_length(http_request_t *request)
>      WCHAR encoding[20];
>      DWORD size;
>  
> 
> -    if(request->status_code == HTTP_STATUS_NO_CONTENT || !wcscmp(request->verb, L"HEAD")) {
> +    if(request->status_code == HTTP_STATUS_NO_CONTENT || request->status_code == HTTP_STATUS_NOT_MODIFIED ||
> +       !wcscmp(request->verb, L"HEAD"))
> +    {
> +        request->read_size = 0;
>          request->contentLength = request->netconn_stream.content_length = 0;
>          return ERROR_SUCCESS;

This is still not correct. I've added some tests on top of yours that
check these responses, with and without Content-Length header.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wininet_tests.diff
Type: text/x-patch
Size: 5682 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210929/267c69e8/attachment.bin>


More information about the wine-devel mailing list