applied patch #1465378 - Speed up NSISdl downloads
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4643 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9dd05f0129
commit
de26b43716
1 changed files with 4 additions and 2 deletions
|
@ -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.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue