git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH v3 6/8] Support remote helpers implementing smart transports

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 7, 2009, 18:11 UTC
Message-ID
<20091207181148.GG17173@spearce.org>
In-Reply-To
<1260116931-16549-7-git-send-email-ilari.liusvaara@elisanet.fi>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
Show 14 quoted lines
> diff --git a/transport-helper.c b/transport-helper.c
> index 3d99fe1..e0254bc 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
>  static int fetch(struct transport *transport,
>  		 int nr_heads, struct ref **to_fetch)
>  {
>  	struct helper_data *data = transport->data;
>  	int i, count;
>  
> +	if (process_connect(transport, 0)) {
> +		transport_take_over(transport);
> +		return transport->fetch(transport, nr_heads, to_fetch);
> +	}

We should already be connected because of the prior call into get_refs_list(). If I read your code correctly we'd try to open a new connection right here, which makes no sense. But its also possible for us to be in a different transport, so we do code with the assumption that we didn't get invoked through get_refs_list() first and therefore need to open the connection ourselves.

Also, given the above invocation pattern, I see no reason why you need the disown virtual function on struct transport*. Just pass the #@!**! struct child* into transport_take_over() from the 3 call sites here and get rid of that unnecessary indirection.

-- 
Shawn.
Previous: Ilari LiusvaaraNext: Ilari Liusvaara
Message 10 of 25 in “Remote helpers smart transport extensions”
  1. 0/8 Remote helpers smart transport extensionsIlari Liusvaara, Dec 6, 2009
  2. 1/8 Add remote helper debug modeIlari Liusvaara, Dec 6, 2009
  3. 2/8 Support mandatory capabilitiesIlari Liusvaara, Dec 6, 2009
  4. 3/8 Pass unknown protocols to external protocol handlersIlari Liusvaara, Dec 6, 2009
  5. 4/8 Refactor git transport options parsingIlari Liusvaara, Dec 6, 2009
  6. 5/8 Support taking over transportsIlari Liusvaara, Dec 6, 2009
  7. Shawn O. PearceDec 7, 2009
  8. Ilari LiusvaaraDec 7, 2009
  9. 6/8 Support remote helpers implementing smart transportsIlari Liusvaara, Dec 6, 2009
  10. Shawn O. PearceDec 7, 2009
  11. Ilari LiusvaaraDec 7, 2009
  12. 7/8 Support remote archive from external protocol helpersIlari Liusvaara, Dec 6, 2009
  13. Shawn O. PearceDec 7, 2009
  14. Ilari LiusvaaraDec 7, 2009
  15. 8/8 Remove special casing of http, https and ftpIlari Liusvaara, Dec 6, 2009
  16. Junio C HamanoDec 7, 2009
  17. Nanako ShiraishiDec 7, 2009
  18. Erik Faye-LundDec 7, 2009
  19. Nicolas PitreDec 7, 2009
  20. Junio C HamanoDec 7, 2009
  21. Nanako ShiraishiDec 7, 2009
  22. Jeff KingDec 8, 2009
  23. Jeff KingDec 8, 2009
  24. Ilari LiusvaaraDec 7, 2009
  25. Junio C HamanoDec 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.