@@ -466,32 +466,32 @@ private boolean exitAfterHandlingConnect(//
466
466
return false ;
467
467
}
468
468
469
- private boolean exitAfterHandlingStatus (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler , NettyResponseStatus status )
469
+ private boolean exitAfterHandlingStatus (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler , NettyResponseStatus status , HttpRequest httpRequest )
470
470
throws IOException , Exception {
471
471
if (!future .getAndSetStatusReceived (true ) && handler .onStatusReceived (status ) != State .CONTINUE ) {
472
- finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (response ));
472
+ finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (httpRequest ) || HttpHeaders . isTransferEncodingChunked ( response ));
473
473
return true ;
474
474
}
475
475
return false ;
476
476
}
477
477
478
- private boolean exitAfterHandlingHeaders (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler , NettyResponseHeaders responseHeaders )
478
+ private boolean exitAfterHandlingHeaders (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler , NettyResponseHeaders responseHeaders , HttpRequest httpRequest )
479
479
throws IOException , Exception {
480
480
if (!response .headers ().isEmpty () && handler .onHeadersReceived (responseHeaders ) != State .CONTINUE ) {
481
- finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (response ));
481
+ finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (httpRequest ) || HttpHeaders . isTransferEncodingChunked ( response ));
482
482
return true ;
483
483
}
484
484
return false ;
485
485
}
486
486
487
- private boolean exitAfterHandlingReactiveStreams (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler ) throws IOException {
487
+ private boolean exitAfterHandlingReactiveStreams (Channel channel , NettyResponseFuture <?> future , HttpResponse response , AsyncHandler <?> handler , HttpRequest httpRequest ) throws IOException {
488
488
if (handler instanceof StreamedAsyncHandler ) {
489
489
StreamedAsyncHandler <?> streamedAsyncHandler = (StreamedAsyncHandler <?>) handler ;
490
490
StreamedResponsePublisher publisher = new StreamedResponsePublisher (channel .eventLoop (), channelManager , future , channel );
491
491
channel .pipeline ().addLast (channel .eventLoop (), "streamedAsyncHandler" , publisher );
492
492
Channels .setAttribute (channel , publisher );
493
493
if (streamedAsyncHandler .onStream (publisher ) != State .CONTINUE ) {
494
- finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (response ));
494
+ finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (httpRequest ) || HttpHeaders . isTransferEncodingChunked ( response ));
495
495
return true ;
496
496
}
497
497
}
@@ -522,8 +522,9 @@ private boolean handleHttpResponse(final HttpResponse response, final Channel ch
522
522
exitAfterHandling100 (channel , future , statusCode ) || //
523
523
exitAfterHandlingRedirect (channel , future , response , request , statusCode , realm ) || //
524
524
exitAfterHandlingConnect (channel , future , request , proxyServer , statusCode , httpRequest ) || //
525
- exitAfterHandlingStatus (channel , future , response , handler , status ) || //
526
- exitAfterHandlingHeaders (channel , future , response , handler , responseHeaders ) || exitAfterHandlingReactiveStreams (channel , future , response , handler );
525
+ exitAfterHandlingStatus (channel , future , response , handler , status , httpRequest ) || //
526
+ exitAfterHandlingHeaders (channel , future , response , handler , responseHeaders , httpRequest ) || //
527
+ exitAfterHandlingReactiveStreams (channel , future , response , handler , httpRequest );
527
528
}
528
529
529
530
private void handleChunk (HttpContent chunk ,//
0 commit comments