summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src/org/eclipse
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-02-15 14:46:30 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-02-15 16:32:51 -0800
commitbd531eb998e233b8be27ef9944cae2c1148db5b6 (patch)
treed14345f4c22f1617f793040f45e407c0f47a1adf /org.eclipse.jgit.http.server/src/org/eclipse
parent18e822a7fefb35e4a68ca4b337541c0a1a222a43 (diff)
downloadjgit-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/org/eclipse')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java7
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();