diff --git a/Contrib/NSISdl/nsisdl.cpp b/Contrib/NSISdl/nsisdl.cpp index 32caf80d..b03f55fd 100644 --- a/Contrib/NSISdl/nsisdl.cpp +++ b/Contrib/NSISdl/nsisdl.cpp @@ -380,8 +380,6 @@ __declspec(dllexport) void download (HWND parent, break; } - Sleep(25); - st = get->run (); if (st == -1) { @@ -423,7 +421,9 @@ __declspec(dllexport) void download (HWND parent, } } + int data_downloaded = 0; while ((len = get->bytes_available ()) > 0) { + data_downloaded++; if (len > 8192) len = 8192; len = get->get_bytes (buf, len); @@ -466,6 +466,8 @@ __declspec(dllexport) void download (HWND parent, } if (GetTickCount() > last_recv_time+timeout_ms) error = "Downloading timed out."; + else if (!data_downloaded) + Sleep(10); } else { error = "Bad response status.";