45
45
import com .ning .http .client .providers .netty .channel .Channels ;
46
46
import com .ning .http .client .providers .netty .future .NettyResponseFuture ;
47
47
import com .ning .http .client .providers .netty .request .NettyRequestSender ;
48
- import com .ning .http .client .providers .netty .response .ResponseBodyPart ;
49
- import com .ning .http .client .providers .netty .response .ResponseHeaders ;
50
- import com .ning .http .client .providers .netty .response .ResponseStatus ;
48
+ import com .ning .http .client .providers .netty .response .NettyResponseBodyPart ;
49
+ import com .ning .http .client .providers .netty .response .NettyResponseHeaders ;
50
+ import com .ning .http .client .providers .netty .response .NettyResponseStatus ;
51
51
import com .ning .http .client .providers .netty .spnego .SpnegoEngine ;
52
52
import com .ning .http .client .uri .UriComponents ;
53
53
@@ -170,7 +170,7 @@ private void finishUpdate(final NettyResponseFuture<?> future, Channel channel,
170
170
markAsDone (future , channel );
171
171
}
172
172
173
- private boolean updateBodyAndInterrupt (NettyResponseFuture <?> future , AsyncHandler <?> handler , ResponseBodyPart bodyPart )
173
+ private boolean updateBodyAndInterrupt (NettyResponseFuture <?> future , AsyncHandler <?> handler , NettyResponseBodyPart bodyPart )
174
174
throws Exception {
175
175
boolean interrupt = handler .onBodyPartReceived (bodyPart ) != STATE .CONTINUE ;
176
176
if (bodyPart .isUnderlyingConnectionToBeClosed ())
@@ -353,7 +353,7 @@ private boolean exitAfterHandlingConnect(//
353
353
}
354
354
355
355
private boolean exitAfterHandlingStatus (Channel channel , NettyResponseFuture <?> future , HttpResponse response ,
356
- AsyncHandler <?> handler , ResponseStatus status ) throws IOException , Exception {
356
+ AsyncHandler <?> handler , NettyResponseStatus status ) throws IOException , Exception {
357
357
if (!future .getAndSetStatusReceived (true ) && handler .onStatusReceived (status ) != STATE .CONTINUE ) {
358
358
finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (response ));
359
359
return true ;
@@ -362,7 +362,7 @@ private boolean exitAfterHandlingStatus(Channel channel, NettyResponseFuture<?>
362
362
}
363
363
364
364
private boolean exitAfterHandlingHeaders (Channel channel , NettyResponseFuture <?> future , HttpResponse response ,
365
- AsyncHandler <?> handler , ResponseHeaders responseHeaders ) throws IOException , Exception {
365
+ AsyncHandler <?> handler , NettyResponseHeaders responseHeaders ) throws IOException , Exception {
366
366
if (!response .headers ().isEmpty () && handler .onHeadersReceived (responseHeaders ) != STATE .CONTINUE ) {
367
367
finishUpdate (future , channel , HttpHeaders .isTransferEncodingChunked (response ));
368
368
return true ;
@@ -377,7 +377,7 @@ private boolean exitAfterHandlingBody(Channel channel, NettyResponseFuture<?> fu
377
377
// no chunks expected, exiting
378
378
if (response .getContent ().readableBytes () > 0 )
379
379
// FIXME no need to notify an empty bodypart?
380
- updateBodyAndInterrupt (future , handler , new ResponseBodyPart (response , null , true ));
380
+ updateBodyAndInterrupt (future , handler , new NettyResponseBodyPart (response , null , true ));
381
381
finishUpdate (future , channel , false );
382
382
return true ;
383
383
}
@@ -399,11 +399,11 @@ private boolean handleHttpResponse(final HttpResponse response,//
399
399
400
400
future .setKeepAlive (!HttpHeaders .Values .CLOSE .equalsIgnoreCase (response .headers ().get (HttpHeaders .Names .CONNECTION )));
401
401
402
- ResponseStatus status = new ResponseStatus (future .getURI (), config , response );
402
+ NettyResponseStatus status = new NettyResponseStatus (future .getURI (), config , response );
403
403
int statusCode = response .getStatus ().getCode ();
404
404
Request request = future .getRequest ();
405
405
Realm realm = request .getRealm () != null ? request .getRealm () : config .getRealm ();
406
- ResponseHeaders responseHeaders = new ResponseHeaders (response .headers ());
406
+ NettyResponseHeaders responseHeaders = new NettyResponseHeaders (response .headers ());
407
407
408
408
return exitAfterProcessingFilters (channel , future , handler , status , responseHeaders )
409
409
|| exitAfterHandling401 (channel , future , response , request , statusCode , realm , proxyServer ) || //
@@ -423,13 +423,13 @@ private void handleChunk(HttpChunk chunk,//
423
423
424
424
boolean last = chunk .isLast ();
425
425
// we don't notify updateBodyAndInterrupt with the last chunk as it's empty
426
- if (last || updateBodyAndInterrupt (future , handler , new ResponseBodyPart (null , chunk , last ))) {
426
+ if (last || updateBodyAndInterrupt (future , handler , new NettyResponseBodyPart (null , chunk , last ))) {
427
427
428
428
// only possible if last is true
429
429
if (chunk instanceof HttpChunkTrailer ) {
430
430
HttpChunkTrailer chunkTrailer = (HttpChunkTrailer ) chunk ;
431
431
if (!chunkTrailer .trailingHeaders ().isEmpty ()) {
432
- ResponseHeaders responseHeaders = new ResponseHeaders (future .getHttpHeaders (), chunkTrailer .trailingHeaders ());
432
+ NettyResponseHeaders responseHeaders = new NettyResponseHeaders (future .getHttpHeaders (), chunkTrailer .trailingHeaders ());
433
433
handler .onHeadersReceived (responseHeaders );
434
434
}
435
435
}
0 commit comments