Thread (99 messages) flat view 99 messages, 7 authors, 2016-12-15

Re: [PATCH v9 5/5] transport: add from_user parameter to is_transport_allowed

From: Jeff King <hidden>
Date: 2016-12-14 20:47:50

On Wed, Dec 14, 2016 at 12:37:52PM -0800, Brandon Williams wrote:
Naively looking at the code (and your longer suggestion), is there a
reason why we couldn't simply have http-walker set CURLOPT_PROTOCOLS
with get_curl_allowed_protocols(0) in the fetch_alternates() function?
That way we just override the CURLOPT_PROTOCOLS value when alternates
are involved.
No, because we may have many curl handles (especially for the
http-walker, which wants to fetch several objects simultaneously), and
they get recycled as needed for many requests.

So setting a restriction there on slot->curl will only cover the one
handle, and miss other ones which may be used later (and likewise, that
one handle with the restriction may get recycled and used for a
non-alternate fetch, and would be unnecessarily restrictive).

That's why any curl-level settings have to happen when we call
get_active_slot(), since that's when we know what we're actually using
the handle for.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help