public void respond(MaybeReq maybeReq, Channel channel, long connId, long handle, int code, boolean isKeepAlive, MediaType contentType, RespBody body, Map<String, String> headers, Map<String, String> cookies) { impl.respond(maybeReq, channel, connId, handle, code, isKeepAlive, contentType, body, headers, cookies); }
void writeResponse(final MaybeReq req, final Channel ctx, final boolean isKeepAlive, final int code, final MediaType contentType, final byte[] content) { startResponse(respOrNull(req), ctx, code, isKeepAlive, contentType); writeContentLengthAndBody(req, ctx, content); }
void write200(MaybeReq req, Channel ctx, boolean isKeepAlive, MediaType contentTypeHeader, byte[] content) { writeResponse(req, ctx, isKeepAlive, 200, contentTypeHeader, content); }
void writeContentLengthAndBody(final MaybeReq req, final Channel ctx, final byte[] body) { writeContentLengthHeader(ctx, body.length); closeHeaders(req, ctx.output()); ctx.write(body); }
public void writeContentLengthHeader(Channel ctx, int len) { impl.writeContentLengthHeader(ctx, len); }
public void writeBadRequest(Channel channel) { impl.writeBadRequest(channel); }
public void write200(MaybeReq req, Channel ctx, boolean isKeepAlive, MediaType contentTypeHeader, byte[] content) { impl.write200(req, ctx, isKeepAlive, contentTypeHeader, content); }
public HttpStatus errorAndDone(Req req, Throwable error, LogLevel logLevel) { return impl.errorAndDone(req, error, logLevel); }
public void writeContentLengthAndBody(MaybeReq req, Channel ctx, ByteArrayOutputStream body) { impl.writeContentLengthAndBody(req, ctx, body); }
public void resume(MaybeReq maybeReq, Channel channel, AsyncLogic logic) { impl.resume(maybeReq, channel, logic); }
public void removeTrailingSlash(Buf buf, BufRange range) { impl.removeTrailingSlash(buf, range); }
public void error(Req req, Throwable error, LogLevel logLevel) { impl.error(req, error, logLevel); }
public void done(Req req) { impl.done(req); }
public void closeHeaders(MaybeReq req, Buf out) { impl.closeHeaders(req, out); }
public void writeHttpResp(MaybeReq req, Channel ctx, boolean isKeepAlive, int code, MediaType contentType, Object value) { impl.writeHttpResp(req, ctx, isKeepAlive, code, contentType, value); }
@Override public HttpStatus handle(Channel ctx, boolean isKeepAlive, Req req) { HttpIO.INSTANCE.write200(HttpUtils.maybe(req), ctx, isKeepAlive, contentType, response); return HttpStatus.DONE; }
private void handleError(Req req, Throwable e) { req.revert(); req.async(); HttpIO.INSTANCE.error(req, e, LogLevel.ERROR); // the Req object will do the rendering req.done(); }
private void renderResponse(int code, MediaType contentType, RespBody body) { rendering = true; completed = body != null; HttpIO.INSTANCE.respond( HttpUtils.maybe(this), channel, connId, handle, code, isKeepAlive, contentType, body, response != null ? response.headers() : null, response != null ? response.cookies() : null ); }
protected void writeBody(Channel ctx, byte[] body, int offset, int length, MediaType contentType) { writeContentTypeHeader(ctx, contentType); HttpIO.INSTANCE.writeContentLengthHeader(ctx, length); ctx.write(CR_LF); ctx.write(body, offset, length); }
public void writeResponse(MaybeReq req, Channel ctx, boolean isKeepAlive, int code, MediaType contentTypeHeader, byte[] content) { impl.writeResponse(req, ctx, isKeepAlive, code, contentTypeHeader, content); }