@Override public void run() { try { final ReceivePack rp = receivePackFactory.create(req, remote); rp.receive(out_r, in_w, System.err); } catch (ServiceNotEnabledException e) {
@Override protected void execute(final DaemonClient dc, final Repository db, @Nullable Collection<String> extraParameters) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create(dc, db); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); rp.receive(in, out, null); } } };
@Override protected void begin(HttpServletRequest req, Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create(req, db); req.setAttribute(ATTRIBUTE_HANDLER, rp); }
@Override protected void begin(HttpServletRequest req, Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create(req, db); InternalHttpServerGlue.setPeerUserAgent( rp, req.getHeader(HDR_USER_AGENT)); req.setAttribute(ATTRIBUTE_HANDLER, rp); }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; ReceivePack rp; try { rp = receivePackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }
@Override protected void execute( final DaemonClient dc, final Repository db ) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create( dc, db ); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); rp.receive( in, out, null ); } } };
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; ReceivePack rp; try { rp = receivePackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED, e.getMessage()); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }
@Override protected void execute(final DaemonClient dc, final Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create(dc, db); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); rp.receive(in, out, null); } } };
@Override protected void execute(final DaemonClient dc, final Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { final ReceivePack rp = receivePackFactory.create(dc, db); final InputStream in = dc.getInputStream(); final OutputStream out = dc.getOutputStream(); rp.receive(in, out, null); } }};
@Override public void run() { try { final ReceivePack rp = receivePackFactory.create(req, remote); rp.receive(out_r, in_w, System.err); } catch (ServiceNotEnabledException e) {
public void run() { try { final ReceivePack rp = receivePackFactory.create(req, remote); rp.receive(out_r, in_w, System.err); } catch (ServiceNotEnabledException e) { // Ignored. Client cannot use this repository. } catch (ServiceNotAuthorizedException e) { // Ignored. Client cannot use this repository. } catch (IOException err) { // Client side of the pipes should report the problem. } catch (RuntimeException err) { // Clients side will notice we went away, and report. } finally { try { out_r.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException e2) { // Ignore close failure, we probably crashed above. } remote.close(); } } };
@Override protected void execute(final DaemonClient dc, final Repository db, @Nullable Collection<String> extraParameters) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = receivePackFactory.create(dc, db); InputStream in = dc.getInputStream(); OutputStream out = dc.getOutputStream(); rp.receive(in, out, null); } } };
@Override public ReceivePack create(HttpServletRequest request, Repository repository) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack receivePack = wrapped.create(request, repository); receivePack.setAllowNonFastForwards(isNonFastForwardAllowed()); receivePack.setPreReceiveHook(hook); receivePack.setPostReceiveHook(hook); // apply collecting listener, to be able to check which commits are new CollectingPackParserListener.set(receivePack); return receivePack; }
@Override protected void execute(final FileSystemUser user, final Repository repository, final InputStream in, final OutputStream out, final OutputStream err, final JGitFileSystem fileSystem) { try { final ReceivePack rp = receivePackFactory.create(this, repository); rp.receive(in, out, err); rp.setPostReceiveHook((rp1, commands) -> { fileSystem.getGit().gc(); fileSystem.resetCommitCount(); }); } catch (final Exception ignored) { } } }
} else { receivePackFactory = (req, repo) -> { final ReceivePack rp = factory.create(req, repo); final KetchLeader leader;