mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
parent
ee34bf495a
commit
63bb308ad6
3 changed files with 26 additions and 12 deletions
|
@ -104,10 +104,19 @@ static __inline void *_reallocf(void *ptr, size_t size) {
|
|||
|
||||
/* MinGW doesn't know these */
|
||||
#ifndef WM_CLIENTSHUTDOWN
|
||||
#define WM_CLIENTSHUTDOWN 0x3B
|
||||
#define WM_CLIENTSHUTDOWN 0x3B
|
||||
#endif
|
||||
#ifndef WM_COPYGLOBALDATA
|
||||
#define WM_COPYGLOBALDATA 0x49
|
||||
#define WM_COPYGLOBALDATA 0x49
|
||||
#endif
|
||||
#ifndef INTERNET_OPTION_ENABLE_HTTP_PROTOCOL
|
||||
#define INTERNET_OPTION_ENABLE_HTTP_PROTOCOL 148
|
||||
#endif
|
||||
#ifndef INTERNET_OPTION_HTTP_DECODING
|
||||
#define INTERNET_OPTION_HTTP_DECODING 65
|
||||
#endif
|
||||
#ifndef HTTP_PROTOCOL_FLAG_HTTP2
|
||||
#define HTTP_PROTOCOL_FLAG_HTTP2 2
|
||||
#endif
|
||||
|
||||
/* The following is used for native ISO mounting in Windows 8 or later */
|
||||
|
|
15
src/net.c
15
src/net.c
|
@ -54,6 +54,7 @@ extern HANDLE dialog_handle;
|
|||
extern BOOL is_x86_32, close_fido_cookie_prompts;
|
||||
static DWORD error_code, fido_len = 0;
|
||||
static BOOL force_update_check = FALSE;
|
||||
static const char* request_headers = "Accept-Encoding: gzip, deflate";
|
||||
|
||||
/*
|
||||
* FormatMessage does not handle internet errors
|
||||
|
@ -264,8 +265,8 @@ static HINTERNET GetInternetSession(BOOL bRetry)
|
|||
{
|
||||
int i;
|
||||
char agent[64];
|
||||
BOOL r;
|
||||
DWORD dwFlags, dwTimeout = NET_SESSION_TIMEOUT;
|
||||
BOOL r, decodingSupport = TRUE;
|
||||
DWORD dwFlags, dwTimeout = NET_SESSION_TIMEOUT, dwProtocolSupport = HTTP_PROTOCOL_FLAG_HTTP2;
|
||||
HINTERNET hSession = NULL;
|
||||
|
||||
PF_TYPE_DECL(WINAPI, BOOL, InternetGetConnectedState, (LPDWORD, DWORD));
|
||||
|
@ -295,6 +296,10 @@ static HINTERNET GetInternetSession(BOOL bRetry)
|
|||
pfInternetSetOptionA(hSession, INTERNET_OPTION_CONNECT_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));
|
||||
pfInternetSetOptionA(hSession, INTERNET_OPTION_SEND_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));
|
||||
pfInternetSetOptionA(hSession, INTERNET_OPTION_RECEIVE_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));
|
||||
// Enable gzip and deflate decoding schemes
|
||||
pfInternetSetOptionA(hSession, INTERNET_OPTION_HTTP_DECODING, (LPVOID)&decodingSupport, sizeof(decodingSupport));
|
||||
// Enable HTTP/2 protocol support
|
||||
pfInternetSetOptionA(hSession, INTERNET_OPTION_ENABLE_HTTP_PROTOCOL, (LPVOID)&dwProtocolSupport, sizeof(dwProtocolSupport));
|
||||
|
||||
out:
|
||||
return hSession;
|
||||
|
@ -384,7 +389,7 @@ uint64_t DownloadToFileOrBuffer(const char* url, const char* file, BYTE** buffer
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (!pfHttpSendRequestA(hRequest, NULL, 0, NULL, 0)) {
|
||||
if (!pfHttpSendRequestA(hRequest, request_headers, -1L, NULL, 0)) {
|
||||
uprintf("Unable to send request: %s", WinInetErrorString());
|
||||
goto out;
|
||||
}
|
||||
|
@ -727,7 +732,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
|
|||
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|
|
||||
INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_UI|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_HYPERLINK|
|
||||
((UrlParts.nScheme == INTERNET_SCHEME_HTTPS)?INTERNET_FLAG_SECURE:0), (DWORD_PTR)NULL);
|
||||
if ((hRequest == NULL) || (!pfHttpSendRequestA(hRequest, NULL, 0, NULL, 0))) {
|
||||
if ((hRequest == NULL) || (!pfHttpSendRequestA(hRequest, request_headers, -1L, NULL, 0))) {
|
||||
uprintf("Unable to send request: %s", WinInetErrorString());
|
||||
goto out;
|
||||
}
|
||||
|
@ -1091,7 +1096,7 @@ BOOL IsDownloadable(const char* url)
|
|||
if (hRequest == NULL)
|
||||
goto out;
|
||||
|
||||
if (!pfHttpSendRequestA(hRequest, NULL, 0, NULL, 0))
|
||||
if (!pfHttpSendRequestA(hRequest, request_headers, -1L, NULL, 0))
|
||||
goto out;
|
||||
|
||||
// Get the file size
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_ACCEPTFILES
|
||||
CAPTION "Rufus 3.11.1661"
|
||||
CAPTION "Rufus 3.11.1662"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
@ -395,8 +395,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,11,1661,0
|
||||
PRODUCTVERSION 3,11,1661,0
|
||||
FILEVERSION 3,11,1662,0
|
||||
PRODUCTVERSION 3,11,1662,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -414,13 +414,13 @@ BEGIN
|
|||
VALUE "Comments", "https://rufus.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "3.11.1661"
|
||||
VALUE "FileVersion", "3.11.1662"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||
VALUE "OriginalFilename", "rufus-3.11.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "3.11.1661"
|
||||
VALUE "ProductVersion", "3.11.1662"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Reference in a new issue