Re: [RFC PATCH v2 3/8] Support taking over transports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ilari Liusvaara <ilari.liusvaara@xxxxxxxxxxx> wrote:
> Add support for taking over transports that turn out to be smart.

I really don't like this disown strategy and its magic ref return
value from fetch.
 
> @@ -1020,7 +1089,13 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs)
>  			heads[nr_heads++] = rm;
>  	}
>  
> +retry:
>  	rc = transport->fetch(transport, nr_heads, heads);
> +	if(rc == TRANSPORT_LAYER6_READY) {
> +		git_take_over_transport(transport);
> +		goto retry;
> +	}

Why can't you expose git_take_over_transport as a public function
and then the transport-helper.c code can instead do:

	... setup connect with helper ...
	transport_takeover(transport, child);
	return transport->fetch(....);

Would this make the code simpler?

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]