-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(installer): Git for Windows Updater #153
Closed
bufferoverflow
wants to merge
2
commits into
git-for-windows:master
from
bufferoverflow:feat/update-scheduler
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
CFLAGS=-O2 -Wall | ||
|
||
all: edit-git-bash.exe | ||
all: edit-git-bash.exe proxy-lookup.exe | ||
|
||
edit-git-bash.exe: edit-git-bash.c | ||
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^ | ||
|
||
proxy-lookup.exe: proxy-lookup.c | ||
gcc $(CFLAGS) -Werror -o $@ $^ -lshell32 -lwinhttp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// based on the sample provided here: https://github.com/git-for-windows/git/issues/387 | ||
// probably inspired by https://msdn.microsoft.com/en-us/library/aa384122(v=vs.85).aspx | ||
|
||
#include <stdio.h> | ||
#define WIN32_LEAN_AND_MEAN | ||
#include <windows.h> | ||
#include <winhttp.h> | ||
#include <shellapi.h> | ||
|
||
LPCWSTR get_proxy_for_url(LPCWSTR url) | ||
{ | ||
WINHTTP_CURRENT_USER_IE_PROXY_CONFIG config; | ||
WINHTTP_AUTOPROXY_OPTIONS options; | ||
WINHTTP_PROXY_INFO info; | ||
|
||
memset(&config, 0, sizeof(config)); | ||
|
||
if (!WinHttpGetIEProxyConfigForCurrentUser(&config)) | ||
config.fAutoDetect = FALSE; | ||
else if (config.lpszAutoConfigUrl) | ||
config.fAutoDetect = TRUE; | ||
|
||
if (config.fAutoDetect) { | ||
HINTERNET handle = WinHttpOpen(L"Proxy Lookup/1.0", | ||
WINHTTP_ACCESS_TYPE_NO_PROXY, | ||
WINHTTP_NO_PROXY_NAME, | ||
WINHTTP_NO_PROXY_BYPASS, 0); | ||
|
||
memset(&options, 0, sizeof(options)); | ||
|
||
// use pac file URL from IE proxy configuration | ||
options.lpszAutoConfigUrl = config.lpszAutoConfigUrl; | ||
|
||
options.fAutoLogonIfChallenged = TRUE; | ||
options.dwFlags = options.lpszAutoConfigUrl ? | ||
WINHTTP_AUTOPROXY_CONFIG_URL : | ||
WINHTTP_AUTOPROXY_AUTO_DETECT; | ||
if (!options.lpszAutoConfigUrl) | ||
options.dwAutoDetectFlags = | ||
WINHTTP_AUTO_DETECT_TYPE_DHCP | | ||
WINHTTP_AUTO_DETECT_TYPE_DNS_A; | ||
|
||
config.fAutoDetect = WinHttpGetProxyForUrl(handle, url, | ||
&options, &info ); | ||
|
||
WinHttpCloseHandle(handle); | ||
} | ||
|
||
if (config.fAutoDetect) | ||
return info.lpszProxy; | ||
return config.lpszProxy; | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
LPWSTR *wargv; | ||
int i, wargc; | ||
|
||
wargv = CommandLineToArgvW(GetCommandLineW(), &wargc); | ||
wprintf(L"Proxy lookup\n"); | ||
|
||
for (i = 1; i < wargc; i++) | ||
wprintf(L"URL: %s, proxy: %s\n", | ||
wargv[i], get_proxy_for_url(wargv[i])); | ||
|
||
return 0; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.