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

Re: [PATCH] Update packfile transfer protocol documentation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 4, 2009, 01:18 UTC
Message-ID
<20091104011802.GE10505@spearce.org>
In-Reply-To
<7vljinnllj.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > I don't think we ever send an empty packet.  If we have no data to
> > send, why the hell did we create the packet header?
> 
> Oh, I do not disagree that it is pointless, but the example that followed
> the part we are discussing also had "0004".  I think it is Ok to allow it.
If its pointless, why encourage it?  Why not discourage it with SHOULD NOT?
 
Show 12 quoted lines
> The original intent of packet_flush() was that everything else could be
> kept buffered in-core without going to write() until packet_flush() is
> called.  The protocol was defined in a way that we won't wait for
> listening a response from the other end to an earlier message we "sent"
> with packet_write() but haven't called packet_flush() yet hence could
> still be in our buffer.  We still have this comment:
> 
>     /*
>      * If we buffered things up above (we don't, but we should),
>      * we'd flush it here
>      */
>     void packet_flush(int fd)
The smart-http series causes fetch-pack to buffer.  :-)
> And once we start buffering, allowing "0004" packet_write() wouldn't even
> be a problem; it can be optimized out in the buffering layer.

Sure, but can't packet_write just return early without write() if format_packet returned 4 (aka vsnprintf returned 0)?

-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 16 in “Update packfile transfer protocol documentation”
  1. Update packfile transfer protocol documentationScott Chacon, Nov 1, 2009
  2. Junio C HamanoNov 2, 2009
  3. Shawn O. PearceNov 2, 2009
  4. Junio C HamanoNov 2, 2009
  5. Shawn O. PearceNov 2, 2009
  6. Junio C HamanoNov 2, 2009
  7. Shawn O. PearceNov 2, 2009
  8. Junio C HamanoNov 3, 2009
  9. Shawn O. PearceNov 3, 2009
  10. Scott ChaconNov 3, 2009
  11. Junio C HamanoNov 4, 2009
  12. Junio C HamanoNov 4, 2009
  13. Shawn O. PearceNov 4, 2009
  14. Junio C HamanoNov 4, 2009
  15. Shawn O. PearceNov 4, 2009
  16. Junio C HamanoNov 4, 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.