Browse Source

win-update: Use correct winhttp proxy type
Legacy one does not provide correct result on some setups, use new one on 10+ .

EBK21 1 year ago
parent
commit
117ee9cf44
2 changed files with 3 additions and 3 deletions
  1. 1 1
      UI/win-update/updater/http.cpp
  2. 2 2
      UI/win-update/updater/updater.cpp

+ 1 - 1
UI/win-update/updater/http.cpp

@@ -76,7 +76,7 @@ bool HTTPPostData(const wchar_t *url, const BYTE *data, int dataLen,
 	 * connect to server                      */
 	 * connect to server                      */
 
 
 	hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
 	hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
-			       WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
+			       WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY,
 			       WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS,
 			       WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS,
 			       0);
 			       0);
 	if (!hSession) {
 	if (!hSession) {

+ 2 - 2
UI/win-update/updater/updater.cpp

@@ -379,7 +379,7 @@ bool DownloadWorkerThread()
 	const DWORD compressionFlags = WINHTTP_DECOMPRESSION_FLAG_ALL;
 	const DWORD compressionFlags = WINHTTP_DECOMPRESSION_FLAG_ALL;
 
 
 	HttpHandle hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
 	HttpHandle hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
-					  WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
+					  WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY,
 					  WINHTTP_NO_PROXY_NAME,
 					  WINHTTP_NO_PROXY_NAME,
 					  WINHTTP_NO_PROXY_BYPASS, 0);
 					  WINHTTP_NO_PROXY_BYPASS, 0);
 	if (!hSession) {
 	if (!hSession) {
@@ -1138,7 +1138,7 @@ static bool UpdateVSRedists()
 	const DWORD compressionFlags = WINHTTP_DECOMPRESSION_FLAG_ALL;
 	const DWORD compressionFlags = WINHTTP_DECOMPRESSION_FLAG_ALL;
 
 
 	HttpHandle hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
 	HttpHandle hSession = WinHttpOpen(L"OBS Studio Updater/3.0",
-					  WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
+					  WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY,
 					  WINHTTP_NO_PROXY_NAME,
 					  WINHTTP_NO_PROXY_NAME,
 					  WINHTTP_NO_PROXY_BYPASS, 0);
 					  WINHTTP_NO_PROXY_BYPASS, 0);
 	if (!hSession) {
 	if (!hSession) {