On 06/22/12 08:36 AM, Brock Pytlik wrote:
On 06/21/12 15:59, Tim Foster wrote:
On 06/21/12 03:50 PM, Brock Pytlik wrote:
https://cr.opensolaris.org/action/browse/pkg/timf/granular-proxies-4/
.
.
That said, I've expanded the comment the comment both here, and in the
read_publisher(..) method.

Sorry, maybe I wasn't clear enough. To be concrete, why not do the
following:
1) move plist = [] from line 646 to line 617.
2) delete lines 612 and 613
3) change every place where the code currently does
info_map.setdefault(r.uri, []).append(<mumble>) to plist.append(<mumble>)
4) remove lines 647 and 648.

Ah, thanks - fixed.

.
.
2831, 2846: could we have an assert of some kind to make sure that we're
only dealing w/ file repos in these methods?

I guess we could - that makes me uneasy though, for now these are the
only consumers, I'm not sure we'll always have that guarantee.

Well, the comment suggests to me that these methods can only validly be
used on file repos, otherwise ignoring the proxy value set on the origin
wouldn't be ok... Mostly I was suggesting putting what's in the comment
in as an assert. If you're concerned about adding an assert, then I'm
concerned about the comment.

:-) That's fair enough. I've removed the comment now, and made sure to check for the use proxies, rather than using an assert.

misc.py:
2361+: If I'm reading this right, then if I set 'http_proxy' in my
environment, that's only going to be applied to uri's that are already
being proxied, just with a different proxy. Do I have that right? That
seems sorta busted to me...

Nope, it's only important to override an existing proxy set for a
given origin - otherwise, the default behaviour of libcurl result in
it using the proxy environment variable (as it does in the gate today).

See, I think that's where I'm confused. If I have 2 publishers
configured, one with a proxied origin and one without, and now I do
http_proxy=http://foo.com, I think I'd expect connections for both
publishers, not just the one with a proxied origin, to be routed through
the foo.com proxy. I think that's not how this code works. Is there a
reason I'd only want one of the two publishers to get proxied via foo.com?

That's not quite it: the get_runtime_proxy method wasn't looking for environment variables when there wasn't an origin-configured proxy, but libcurl would still use them internally (since we're not explicitly telling it which proxy to use), so everything would continue to get proxied though foo.com in your example.

That said, I still made the change you suggested, because of the problem I mentioned with stats dump reporting (where even without origin-configured proxies, we still need to grab the environment variable in order to print which proxy was used)

        cheers,
                        tim
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to