Fossil

Timeline
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Purpose of this branch and the problem it solve:
  • It prevent the remote-url from being replaced by the Proxy setting
    when url_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 permit transport_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.proxyUrlPath field already works a similar
        way to backup the original path part of the url when a proxy
        is used. So this branch try to reproduce similar pattern with
        a new g.url.proxyUrlCanonical field.
  • 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)

    • when printing some info on screen (call of sync_explain())
      • (trunk will print: e.g. "pull from <the proxy url>")

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)

7 check-ins related to "fix_remote_url_overwrite_with_proxy"
2022-05-11
15:42
Fix remote-url overwriting by proxy url bug and use the http_proxy environment variable only when explicitly requested by setting the proxy setting to "system". ... (check-in: a791d5e805 user: mgagnon tags: trunk)
15:34
Only use the "http_proxy" environment variable if it is set to "system", if unset or set to "off", always use direct http connection. ... (Closed-Leaf check-in: a242bb727e user: mgagnon tags: fix_remote_url_overwrite_with_proxy)
15:06
Merge in latest changes from trunk ... (check-in: 5605aef9b9 user: mgagnon tags: fix_remote_url_overwrite_with_proxy)
11:50
Show the OpenSSL version and the SERVER_SOFTWARE to administrators on the /stat page. ... (check-in: bb09ff84ae user: drh tags: trunk)
2022-05-03
04:02
Simplification by omitting g.url.user and g.url.password backup copy since they are only swapped during short time and are restored right away. Also rename url.canonical backup copy to "proxyUrlCanonical" following name convention of already existing "proxyUrlPath" field. ... (check-in: 78a5195392 user: mgagnon tags: fix_remote_url_overwrite_with_proxy)
2022-04-28
14:25
attempt to fix issue where the remote-url saved is overwritten by the proxy url. (issue introduced by checkin [c129f29566439e5c]) ... (check-in: 83ffea65ca user: mgagnon tags: fix_remote_url_overwrite_with_proxy)
2022-04-27
12:11
Update the built-in SQLite to the latest trunk version which includes all of the fixes that went into version 3.38.3. ... (check-in: f905bd0d8d user: drh tags: trunk)