Avoid deadlock while fetching from local repository
commit164921708417c936949419d20473913ab39e9f00
authorShawn O. Pearce <spearce@spearce.org>
Wed, 9 Jul 2008 04:15:28 +0000 (9 00:15 -0400)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 9 Jul 2008 22:57:54 +0000 (10 00:57 +0200)
treecf966062dc763aca1d11964dca6c7d0aa7ab8002
parent6b41689b9f3ea1305ceb6cf3513e2530c9870e80
Avoid deadlock while fetching from local repository

We cannot send a packet line end command to git-upload-pack after we
have sent our want list and obtained a pack back from it.  Once the
want list has ended git-upload-pack wants no further data sent to
it, and attempting to write more may cause us to deadlock as the
pipe won't accept the data.

Not sending the packet line end if we don't send a want list is a
(minor) protocol error.  To avoid these protocol errors (which
may display on stderr from git-upload-pack) we still send the end
during close if we have not yet sent a want list.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/BasePackFetchConnection.java
org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java