diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-02-15 14:46:30 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-02-15 16:32:51 -0800 |
commit | bd531eb998e233b8be27ef9944cae2c1148db5b6 (patch) | |
tree | d14345f4c22f1617f793040f45e407c0f47a1adf /org.eclipse.jgit.http.server/src | |
parent | 18e822a7fefb35e4a68ca4b337541c0a1a222a43 (diff) | |
download | jgit-bd531eb998e233b8be27ef9944cae2c1148db5b6.tar.gz jgit-bd531eb998e233b8be27ef9944cae2c1148db5b6.zip |
smart-http: Support progress in ReceivePack
As PackParser supports a progress meter for the "Resolving deltas"
phase of its work, we should export this to smart HTTP clients so
they know the server is still working on their (large) upload.
However this isn't as simple as just dropping in a binding for
the SmartOutputStream to flush when its told to. We want to
avoid spurious flushes triggered by the use of sideband, or the
status report formatting in the send-pack/receive-pack protocol.
Change-Id: Ibd88022a298c5fed0edb23dfaf2e90278807ba8b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java index a85e84b210..bb4ae19e78 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java @@ -112,7 +112,12 @@ class ReceivePackServlet extends HttpServlet { rp.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(); + } + }; rp.receive(getInputStream(req), out, null); out.close(); |