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

Re: [PATCH] git-daemon wrapper to wait until daemon is ready

From
Clemens Buchacher <drizzd@aon.at>
Date
Apr 15, 2012, 19:32 UTC
Message-ID
<20120415193242.GA1960@ecki>
In-Reply-To
<4F8B0158.4040407@kdbg.org>
On Sun, Apr 15, 2012 at 07:11:52PM +0200, Johannes Sixt wrote:
> 
> But reading the first line in this way needs a few assumptions to be true:
> 
> - git-daemon does not write an incomplete line and then waits.
Yes. One way to avoid that assumption would be a timeout.
> - git-daemon does not write more than one line, because xread() happily
> reads everything it can get. Your implementation differs from the old
> version because the shell's 'read' is required to read no more than one
> line, i.e., to read byte-wise from the pipe until it sees the LF.

The strbuf_getwholeline_fd implementation calls xread(fd, buf, 1), reading only one byte at a time. It does not try to read beyond the newline.

Previous: Johannes SixtNext: Johannes Sixt
Message 17 of 18 in “git-daemon wrapper to wait until daemon is ready”
  1. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 14, 2012
  2. t5570: use explicit push refspecClemens Buchacher, Apr 14, 2012
  3. Junio C HamanoApr 14, 2012
  4. Clemens BuchacherApr 15, 2012
  5. Junio C HamanoApr 15, 2012
  6. Clemens BuchacherApr 15, 2012
  7. Junio C HamanoApr 15, 2012
  8. Ben WaltonApr 14, 2012
  9. Clemens BuchacherApr 14, 2012
  10. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 14, 2012
  11. Johannes SixtApr 14, 2012
  12. Clemens BuchacherApr 14, 2012
  13. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 15, 2012
  14. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  15. Junio C HamanoApr 19, 2012
  16. Johannes SixtApr 15, 2012
  17. Clemens BuchacherApr 15, 2012
  18. Johannes SixtApr 15, 2012

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.