Fossil SCM
branch/fix_remote_url_overwrite_with_proxy
Purpose of this branch and the problem it solve:
-
It prevent the remote-url from being replaced by the Proxy setting
whenurl_remember()is called at any time after the function
url_enable_proxy(). -
url_enable_proxy()function replace g.url.canonical by the
proxy address to permittransport_open()function down the
road to connect at the proxy address where and the full canonical
is used inside the http header payload to inform the proxy about
destination address to connect. -
This code doesn't change anything in the existing content of g.url.
It just added 1 new field which keep a backup of the original
canonical url when http_proxy is use, so it can use this backup
when code was intended to use the real server address instead of
the proxy.- The existing
g.url.proxyUrlPathfield already works a similar
way to backup the originalpathpart of the url when a proxy
is used. So this branch try to reproduce similar pattern with
a newg.url.proxyUrlCanonicalfield.
- The existing
-
examples:
-
when it's time to save the remote-url in repo or global config
database.- (trunk will overwrite with proxy address when sync is
successful and proxy is used)
- (trunk will overwrite with proxy address when sync is
-
when printing some info on screen (call of
sync_explain())- (trunk will print: e.g. "
pull from <the proxy url>")
- (trunk will print: e.g. "
Tested and seems to works with and without proxy set, (from env variable
or proxy setting).
Side note:
One could say that the ideal fix would be to change
transport_open() to check if a proxy is use and connect to the
proxy ip that would be saved in a distinct field (may be inside g.url).
But this would be a much more invasive change that can potentially break
stuff. The way this branch is implemented now, it is almost a no-op when
a proxy is not use, and a very small change when proxy is use.
(the diff is way smaller than this wiki)