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

Re: [REROLL PATCH 5/8] Support taking over transports

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2009, 21:08 UTC
Message-ID
<7vein3onxf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091209151718.GE15673@Knoppix>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 12 quoted lines
>> Who guarantees that reading from the (FILE *)data->out by strbuf_getline()
>> that eventually calls into fgetc() does not cause more data be read in the
>> buffer assiciated with the (FILE *) than we will consume?  The other FILE*
>> you will make out of helper->out won't be able to read what data->out has
>> already slurped in to its stdio buffer.
>
> Causality impiles this can happen only if buffered version gets its buffer
> filled after sending connect command. And looking at stdio operations that
> can occur after sending the command:
>
> - fprintfs on stderr (debug mode only).
> - fgetc()s on unbuffered version.

I was worried about the "capabilities" loop in get_helper() if it reads too much from data->out (causing helper->out to lose the beginning of what it should read), but as you said, by "Causality" it cannot happen. The protocol during that phase works with the other end in lock-step, and the other end wouldn't have written to the pipe what we shouldn't read in that loop (e.g. remote-curl.c responds with "capabilities" with lines and ends with fflush(), and after that it waits for us to talk to it --- it would never start talking by itself without first being asked to talk).

Is data->out only used inside get_helper() to read the capabilities response? I was confused by it being keft open until disconnect time.

Previous: Ilari LiusvaaraNext: Ilari Liusvaara
Message 15 of 23 in “Remote helpers smart transport extensions”
  1. 0/8 Remote helpers smart transport extensionsIlari Liusvaara, Dec 8, 2009
  2. 1/8 Add remote helper debug modeIlari Liusvaara, Dec 8, 2009
  3. Junio C HamanoDec 8, 2009
  4. 2/8 Support mandatory capabilitiesIlari Liusvaara, Dec 8, 2009
  5. Junio C HamanoDec 8, 2009
  6. Ilari LiusvaaraDec 9, 2009
  7. 3/8 Pass unknown protocols to external protocol handlersIlari Liusvaara, Dec 8, 2009
  8. Junio C HamanoDec 8, 2009
  9. Bert WesargDec 9, 2009
  10. Ilari LiusvaaraDec 9, 2009
  11. 4/8 Refactor git transport options parsingIlari Liusvaara, Dec 8, 2009
  12. 5/8 Support taking over transportsIlari Liusvaara, Dec 8, 2009
  13. Junio C HamanoDec 8, 2009
  14. Ilari LiusvaaraDec 9, 2009
  15. Junio C HamanoDec 9, 2009
  16. Ilari LiusvaaraDec 9, 2009
  17. 6/8 Support remote helpers implementing smart transportsIlari Liusvaara, Dec 8, 2009
  18. Junio C HamanoDec 8, 2009
  19. Ilari LiusvaaraDec 9, 2009
  20. 7/8 Support remote archive from external protocol helpersIlari Liusvaara, Dec 8, 2009
  21. Junio C HamanoDec 8, 2009
  22. Ilari LiusvaaraDec 9, 2009
  23. 8/8 Remove special casing of http, https and ftpIlari Liusvaara, Dec 8, 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.