Commit 061b6a83 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Fixed buffer size calculation.

parent 30df52ca
...@@ -1002,20 +1002,18 @@ static HRESULT report_data(BindProtocol *This, DWORD bscf, ULONG progress, ULONG ...@@ -1002,20 +1002,18 @@ static HRESULT report_data(BindProtocol *This, DWORD bscf, ULONG progress, ULONG
do { do {
read = 0; read = 0;
hres = IInternetProtocol_Read(This->protocol, This->buf+This->buf_size, BUFFER_SIZE-This->buf_size, &read); hres = IInternetProtocol_Read(This->protocol, This->buf+This->buf_size,
if(hres != S_OK) BUFFER_SIZE-This->buf_size, &read);
break; if(FAILED(hres) && hres != E_PENDING)
return hres;
This->buf_size += read; This->buf_size += read;
}while(This->buf_size < MIME_TEST_SIZE); }while(This->buf_size < MIME_TEST_SIZE && hres == S_OK);
if(FAILED(hres) && hres != E_PENDING)
return hres;
This->buf_size += read;
if(This->buf_size < MIME_TEST_SIZE && hres != S_FALSE) if(This->buf_size < MIME_TEST_SIZE && hres != S_FALSE)
return S_OK; return S_OK;
hres = FindMimeFromData(NULL, This->url, This->buf, min(This->buf_size, MIME_TEST_SIZE),
hres = FindMimeFromData(NULL, This->url, This->buf, min(This->buf_size, MIME_TEST_SIZE), This->mime, 0, &mime, 0); This->mime, 0, &mime, 0);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
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