summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/proxy.cc
Commit message (Collapse)AuthorAgeFilesLines
* Include our config.h in all C++ files to avoid ODR violationsDavid Kalnischkies2022-05-071-0/+2
| | | | | | | Some of our headers use APT_COMPILING_APT trickery to avoid exposing too broadly details we don't want external clients to know and make use of. The flip-side is that this can lead to different compilation units seeing different definitions if they aren't all using the same config.
* Run the ProxyAutoDetect script in the sandbox againJulian Andres Klode2017-10-221-1/+1
| | | | | | | | The previous change moved running the proxy detection program from the method to the main process, so it runs as root and not as _apt. This brings it back into the sandbox. Gbp-Dch: ignore
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-7/+7
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* Allow http(s) and socks5h for http and https in proxy auto detectJulian Andres Klode2017-06-301-1/+16
| | | | This makes it possible to write sensible auto detect scripts.
* Show permission error if ProxyAutoDetect cmd can't be executedDavid Kalnischkies2017-06-261-1/+5
| | | | | | | | | | As the proxy commands are not executed as root, a user can run into permission errors (s)he isn't expecting – as our switching is an implementation detail – so the error message in that case should really be better than a generic "error code 100" sending the user in the wrong direction as that implies the command was executed, but errored out. Closes: 857885
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-1/+1
| | | | | | | | Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
* Do not read stderr from proxy autodetection scriptsJulian Andres Klode2016-10-041-1/+1
| | | | | | | | | | | | | This fixes a regression introduced in commit 8f858d560e3b7b475c623c4e242d1edce246025a don't leak FD in AutoProxyDetect command return parsing which accidentally made the proxy autodetection code also read the scripts output on stderr, not only on stdout when it switched the code from popen() to Popen(). Reported-By: Tim Small <tim@seoss.co.uk>
* implement and document DIRECT for auto-detect-proxyDavid Kalnischkies2016-06-201-6/+13
| | | | | | | There is a subtile difference between an empty setting and "DIRECT" in the configuration as the later overrides the generic settings while the earlier does not. Also, non-zero exitcodes should really be reported as an error rather than silently discarded.
* do not error if auto-detect-proxy cmd has no outputDavid Kalnischkies2016-06-201-1/+1
| | | | | | | | | | | Regression introduced in 8f858d560e3b7b475c623c4e242d1edce246025a. Commands are probably better of always having output through as the fall through to the generic proxy settings is likely not intended. As documenting and implementing this more consistently is kind of a regression through, it is split off into the next commit. Closes: 827713
* don't leak FD in AutoProxyDetect command return parsingDavid Kalnischkies2016-06-101-35/+20
| | | | | Just closing the fd would be enough, but while we are at it we can also use the Popen interface to have an easier time with this.
* Allow override of Proxy-Auto-Detect by the users configurationMichael Vogt2014-09-121-0/+4
| | | | | | | Only run the Proxy-Auto-Detect code if there is not already a host specific configuration. Closes: 759264
* Make Proxy-Auto-Detect check for each hostMichael Vogt2014-09-021-0/+82
When doing Acquire::http{,s}::Proxy-Auto-Detect, run the auto-detect command for each host instead of only once. This should make using "proxy" from libproxy-tools feasible which can then be used for PAC style or other proxy configurations. Closes: #759264