aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-02-18 19:00:23 -0600
committerSean Hall <r.sean.hall@gmail.com>2022-02-19 11:53:06 -0700
commitf94e47a9e1b6d4366e5d2c8e850067204d0c5dc9 (patch)
tree94b51b1c662a79b3636519d6e8e3448e1118f477
parent28c0a27ddf03dcf07a11c291699428a32f381fbc (diff)
downloadwix-f94e47a9e1b6d4366e5d2c8e850067204d0c5dc9.tar.gz
wix-f94e47a9e1b6d4366e5d2c8e850067204d0c5dc9.tar.bz2
wix-f94e47a9e1b6d4366e5d2c8e850067204d0c5dc9.zip
Parse the Content-Length string value to avoid the 2GB limitation.
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inetutil.cpp14
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs4
2 files changed, 8 insertions, 10 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inetutil.cpp b/src/libs/dutil/WixToolset.DUtil/inetutil.cpp
index 8dace55f..c4cddd11 100644
--- a/src/libs/dutil/WixToolset.DUtil/inetutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/inetutil.cpp
@@ -30,16 +30,14 @@ extern "C" HRESULT DAPI InternetGetSizeByHandle(
30 Assert(pllSize); 30 Assert(pllSize);
31 31
32 HRESULT hr = S_OK; 32 HRESULT hr = S_OK;
33 DWORD dwSize = 0; 33 LPWSTR sczValue = NULL;
34 DWORD cb = 0;
35 34
36 cb = sizeof(dwSize); 35 hr = InternetQueryInfoString(hiFile, HTTP_QUERY_CONTENT_LENGTH, &sczValue);
37 if (!::HttpQueryInfoW(hiFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, reinterpret_cast<LPVOID>(&dwSize), &cb, NULL)) 36 InetExitOnLastError(hr, "Failed to get content length string for internet file handle");
38 { 37
39 InetExitOnLastError(hr, "Failed to get size for internet file handle"); 38 hr = StrStringToInt64(sczValue, 0, pllSize);
40 } 39 InetExitOnLastError(hr, "Failed to parse size for internet file handle: %ls", sczValue);
41 40
42 *pllSize = dwSize;
43LExit: 41LExit:
44 return hr; 42 return hr;
45} 43}
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
index ee61baff..943939e3 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
@@ -110,7 +110,7 @@ namespace WixToolsetTest.BurnE2E
110 } 110 }
111 111
112 Assert.False(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); 112 Assert.False(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
113 Assert.True(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); 113 Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
114 } 114 }
115 115
116 [Fact] 116 [Fact]
@@ -123,7 +123,7 @@ namespace WixToolsetTest.BurnE2E
123 } 123 }
124 124
125 Assert.True(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); 125 Assert.True(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
126 Assert.True(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); 126 Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
127 } 127 }
128 128
129 [Fact] 129 [Fact]