fixed bug #1713562 - NSISdl doesn't finish download after content-length bytes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5154 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-05-23 15:59:24 +00:00
parent fcfe33c05b
commit 5e314f1c0f

View file

@ -469,7 +469,21 @@ __declspec(dllexport) void download (HWND parent,
}
}
if (GetTickCount() > last_recv_time+timeout_ms)
error = "Downloading timed out.";
{
if (sofar != cl)
{
error = "Downloading timed out.";
}
else
{
// workaround for bug #1713562
// buggy servers that wait for the client to close the connection.
// another solution would be manually stopping when cl == sofar,
// but then buggy servers that return wrong content-length will fail.
bSuccess = TRUE;
error = "success";
}
}
else if (!data_downloaded)
Sleep(10);