new GrizzlyResponseStatus(responsePacket, context.getAhcRequest().getUri(), provider.getClientConfig());
boolean isGracefullyFinishResponseOnClose() { final HttpResponsePacket response = responseStatus.getResponse(); return !response.getProcessingState().isKeepAlive() && !response.isChunked() && response.getContentLength() == -1; }
new GrizzlyResponseStatus((HttpResponsePacket) httpHeader, context.request.getURI(), provider.clientConfig);
@Override public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException { if (event.type() == GracefulCloseEvent.class) { // Connection was closed. // This event is fired only for responses, which don't have // associated transfer-encoding or content-length. // We have to complete such a request-response processing gracefully. final GracefulCloseEvent closeEvent = (GracefulCloseEvent) event; final HttpResponsePacket response = closeEvent.getHttpTxContext() .responseStatus.getResponse(); response.getProcessingState().getHttpContext().attach(ctx); onHttpPacketParsed(response, ctx); return ctx.getStopAction(); } return ctx.getInvokeAction(); }
new GrizzlyResponseStatus(responsePacket, context.getAhcRequest().getUri(), provider.getClientConfig());
@Override public void onClosed(Closeable closeable, CloseType type) throws IOException { if (responseStatus != null && // responseStatus==null if request wasn't even sent isGracefullyFinishResponseOnClose()) { // Connection was closed. // This event is fired only for responses, which don't have // associated transfer-encoding or content-length. // We have to complete such a request-response processing gracefully. final Connection c = responseStatus.getResponse() .getRequest().getConnection(); final FilterChain fc = (FilterChain) c.getProcessor(); fc.fireEventUpstream(c, new GracefulCloseEvent(HttpTransactionContext.this), null); } else if (CloseType.REMOTELY.equals(type)) { abort(REMOTELY_CLOSED_EXCEPTION); } } };
new GrizzlyResponseStatus(responsePacket, context.getAhcRequest().getUri(), provider.getClientConfig());