aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/win_updater/updater.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/win_updater/updater.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/win_updater/updater.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/linden/indra/win_updater/updater.cpp b/linden/indra/win_updater/updater.cpp
index 35fbf40..5ea4695 100644
--- a/linden/indra/win_updater/updater.cpp
+++ b/linden/indra/win_updater/updater.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -41,6 +41,7 @@
41#define BUFSIZE 8192 41#define BUFSIZE 8192
42 42
43int gTotalBytesRead = 0; 43int gTotalBytesRead = 0;
44DWORD gTotalBytes = -1;
44HWND gWindow = NULL; 45HWND gWindow = NULL;
45WCHAR gProgress[256]; 46WCHAR gProgress[256];
46char* gUpdateURL; 47char* gUpdateURL;
@@ -129,6 +130,9 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
129 return success; 130 return success;
130 } 131 }
131 132
133 DWORD sizeof_total_bytes = sizeof(gTotalBytes);
134 HttpQueryInfo(hdownload, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &gTotalBytes, &sizeof_total_bytes, NULL);
135
132 DWORD total_bytes = 0; 136 DWORD total_bytes = 0;
133 success = InternetQueryDataAvailable(hdownload, &total_bytes, 0, 0); 137 success = InternetQueryDataAvailable(hdownload, &total_bytes, 0, 0);
134 if (success == FALSE) 138 if (success == FALSE)
@@ -187,7 +191,11 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
187 191
188 gTotalBytesRead += int(bytes_read); 192 gTotalBytesRead += int(bytes_read);
189 193
190 wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024); 194 if (gTotalBytes != -1)
195 wsprintf(gProgress, L"Downloaded: %d%%", 100 * gTotalBytesRead / gTotalBytes);
196 else
197 wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024);
198
191 } 199 }
192 200
193#if _DEBUG 201#if _DEBUG