private static void send(HttpServletRequest req, HttpServletResponse res, String type, byte[] buf) throws IOException { ServletUtils.consumeRequestBody(req); res.setStatus(HttpServletResponse.SC_OK); res.setContentType(type); res.setContentLength(buf.length); OutputStream os = res.getOutputStream(); try { os.write(buf); } finally { os.close(); } }
private static void send(HttpServletRequest req, HttpServletResponse res, String type, byte[] buf) throws IOException { ServletUtils.consumeRequestBody(req); res.setStatus(HttpServletResponse.SC_OK); res.setContentType(type); res.setContentLength(buf.length); OutputStream os = res.getOutputStream(); try { os.write(buf); } finally { os.close(); } }
/** * Consume the entire request body, if one was supplied. * * @param req * the request whose body must be consumed. */ public static void consumeRequestBody(HttpServletRequest req) { if (0 < req.getContentLength() || isChunked(req)) { try { consumeRequestBody(req.getInputStream()); } catch (IOException e) { // Ignore any errors obtaining the input stream. } } }
/** * Consume the entire request body, if one was supplied. * * @param req * the request whose body must be consumed. */ public static void consumeRequestBody(HttpServletRequest req) { if (0 < req.getContentLength() || isChunked(req)) { try { consumeRequestBody(req.getInputStream()); } catch (IOException e) { // Ignore any errors obtaining the input stream. } } }
consumeRequestBody(req); out.close(); } else if (!rsp.isCommitted()) { HttpServerText.get().internalErrorDuringUploadPack, e.getCause()); consumeRequestBody(req); out.close();
HttpServerText.get().internalErrorDuringReceivePack, e.getCause()); consumeRequestBody(req); out.close();
e.getMessage(), ServletUtils.identify(rp.getRepository()))); consumeRequestBody(req); out.close(); consumeRequestBody(req); out.close();
consumeRequestBody(req); out.close(); } else if (!rsp.isCommitted()) { consumeRequestBody(req); out.close();
} else { if (httpStatus < 400) ServletUtils.consumeRequestBody(req); res.sendError(httpStatus);
} else { if (httpStatus < 400) ServletUtils.consumeRequestBody(req); res.sendError(httpStatus);