From 5ed96eb7f44edb06ebf17eece0f9679ee5713446 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 14 Jun 2010 12:37:17 -0700 Subject: [PATCH] UploadPack: Avoid unnecessary flush in smart HTTP Under smart HTTP the biDirectionalPipe flag is false, and we return back immediately at this point in the negotiation process. There is no need to flush the stream to the client, the request is over and it will be automatically flushed out by the higher level servlet that invoked us. Avoiding flush here allows us to only use flush after a progress message is sent during pack generation. Change-Id: Id0c8b7e95e3be6ca4c1b479e096bed6b0283b828 Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 3381c0724..77cc1a6f0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -428,9 +428,9 @@ private boolean negotiate() throws IOException { if (line == PacketLineIn.END) { if (commonBase.isEmpty() || multiAck != MultiAck.OFF) pckOut.writeString("NAK\n"); - pckOut.flush(); if (!biDirectionalPipe) return false; + pckOut.flush(); } else if (line.startsWith("have ") && line.length() == 45) { final ObjectId id = ObjectId.fromString(line.substring(5));