Skip to content

Commit 34202c7

Browse files
committed
fix NPE on request timeout
abort sets channel to null without closing it, which causes NPE on getPipeline, which results in FutureTask ressetting without channel ever being closed.
1 parent 452be89 commit 34202c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,8 @@ public synchronized void run() {
17461746
if (p != null && p.getRequestTimeoutInMs() != -1) {
17471747
requestTimeout = p.getRequestTimeoutInMs();
17481748
}
1749-
abort(this.nettyResponseFuture, new TimeoutException(String.format("No response received after %s", requestTimeout)));
17501749
markChannelNotReadable(channel.getPipeline().getContext(NettyAsyncHttpProvider.class));
1750+
abort(this.nettyResponseFuture, new TimeoutException(String.format("No response received after %s", requestTimeout)));
17511751

17521752
this.nettyResponseFuture = null;
17531753
this.channel = null;

0 commit comments

Comments
 (0)