From bd531eb998e233b8be27ef9944cae2c1148db5b6 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 15 Feb 2011 14:46:30 -0800 Subject: 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 --- .../src/org/eclipse/jgit/http/server/ReceivePackServlet.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.http.server/src/org/eclipse/jgit') 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(); -- cgit v1.2.3