diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-06-14 12:49:41 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-06-23 17:32:41 -0700 |
commit | ccd0c0c911b4575539ea46a3efaf219a249ee392 (patch) | |
tree | 3c997c5b59269f2625164ed893e66a5c40ef0f65 /org.eclipse.jgit.http.server/src/org/eclipse/jgit | |
parent | b6ba9739d5e10e18ecff13095204d71e95837392 (diff) | |
download | jgit-ccd0c0c911b4575539ea46a3efaf219a249ee392.tar.gz jgit-ccd0c0c911b4575539ea46a3efaf219a249ee392.zip |
UploadPack: Permit flushing progress messages under smart HTTP
If UploadPack invokes flush() on the output stream we pass it, its
most likely the progress messages coming down the side band stream.
As pack generation can take a while, we want to push that down
at the client as early as we can, to keep the connection alive,
and to let the user know we are still working on their behalf.
Ensure we dump the temporary buffer whenever flush() is invoked,
otherwise the messages don't get sent in a timely fashion to the
user agent (in this case, git fetch).
We specifically don't implement flush() for ReceivePack right now,
as that protocol currently does not provide progress messages to
the user, but it does invoke flush several times, as the different
streams include '0000' type flush-pkts to denote various end points.
Change-Id: I797c90a2c562a416223dc0704785f61ac64e0220
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.http.server/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java index 92d41a0caf..6d0d64fc63 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java @@ -107,7 +107,12 @@ class UploadPackServlet extends HttpServlet { up.setBiDirectionalPipe(false); rsp.setContentType(RSP_TYPE); - final SmartOutputStream out = new SmartOutputStream(req, rsp); + final SmartOutputStream out = new SmartOutputStream(req, rsp) { + @Override + public void flush() throws IOException { + doFlush(); + } + }; up.upload(getInputStream(req), out, null); out.close(); |