path: root/git-compat-util.h
diff options
authorJohannes Sixt <>2007-11-17 22:09:28 (GMT)
committerJunio C Hamano <>2007-11-18 04:27:29 (GMT)
commit1f759eeede0597580be8ce26305550350e3c017a (patch)
tree4fd24e79e76c697ebf1bf670c2980d4526910ac0 /git-compat-util.h
parent5f9ffff308845e2439670ec3cb2c12f4865cf430 (diff)
fetch-pack: Prepare for a side-band demultiplexer in a thread.
get_pack() receives a pair of file descriptors that communicate with upload-pack at the remote end. In order to support the case where the side-band demultiplexer runs in a thread, and, hence, in the same process as the main routine, we must not close the readable file descriptor early. The handling of the readable fd is changed in the case where upload-pack supports side-band communication: The old code closed the fd after it was inherited to the side-band demultiplexer process. Now we do not close it. The caller (do_fetch_pack) will close it later anyway. The demultiplexer is the only reader, it does not matter that the fd remains open in the main process as well as in unpack-objects/index-pack, which inherits it. The writable fd is not needed in get_pack(), hence, the old code closed the fd. For symmetry with the readable fd, we now do not close it; the caller (do_fetch_pack) will close it later anyway. Therefore, the new behavior is that the channel now remains open during the entire conversation, but this has no ill effects because upload-pack does not read from it once it has begun to send the pack data. For the same reason it does not matter that the writable fd is now inherited to the demultiplexer and unpack-objects/index-pack processes. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'git-compat-util.h')
0 files changed, 0 insertions, 0 deletions