/** * Sets the specified {@link HttpResponse} which responds to this request. This is always called * by the {@link HttpServerHandler} after the handler gets the {@link HttpResponse} from a {@link Service}. */ void setResponse(HttpResponse response) { if (isResponseAborted) { // This means that we already tried to close the request, so abort the response immediately. if (!response.isComplete()) { response.abort(); } } else { this.response = response; } }
/** * Aborts the {@link HttpResponse} which responds to this request if it exists. * * @see Http2RequestDecoder#onRstStreamRead(ChannelHandlerContext, int, long) */ void abortResponse(Throwable cause) { isResponseAborted = true; // Try to close the request first, then abort the response if it is already closed. if (!tryClose(cause) && response != null && !response.isComplete()) { response.abort(); } } }
private void doExecute0(ClientRequestContext ctx, HttpRequestDuplicator rootReqDuplicator, HttpRequest originalReq, HttpResponse returnedRes, CompletableFuture<HttpResponse> future, boolean hasInitialAuthority) { if (originalReq.completionFuture().isCompletedExceptionally() || returnedRes.isComplete()) {