Re: Request for detailed documentation of git pack protocol
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jun 3, 2009, 02:15 UTC
- Message-ID
- <20090603021518.GB3355@spearce.org>
- In-Reply-To
- <7vab4qdq2j.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> One thing that I did not see mentioned in this thread is that the > implementation is allowed to buffer non-flush packets and send multiple of > them out with a single write(2). In other words, packet_write() could > buffer instead of directly calling safe_write(), while packet_flush() must > do safe_write() and make sure it drains.
Good point.
That's one reason why in JGit I call the flush packet of "0000" end(), and flush() triggers the drain. JGit buffers everything its writing, but only by one standard "have" window IIRC.
JGit server code triggers a flush() after side-band channel 2 packet ends, but not an end(), because we only want to drain to the network, not inject a bad "0000" packet in the stream.
-- Shawn.