Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 15a6f92

Browse files
author
Rachid Ben Moussa
committedFeb 10, 2021
Changed future.channel() to channel which is guarded to be non null
1 parent 2222b03 commit 15a6f92

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed
 

‎client/src/main/java/org/asynchttpclient/netty/request/NettyRequestSender.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ private void scheduleReadTimeout(NettyResponseFuture<?> nettyResponseFuture) {
464464
public void abort(Channel channel, NettyResponseFuture<?> future, Throwable t) {
465465

466466
if (channel != null) {
467-
Object attribute = Channels.getAttribute(future.channel());
467+
Object attribute = Channels.getAttribute(channel);
468468
if (attribute instanceof StreamedResponsePublisher) {
469469
((StreamedResponsePublisher) attribute).setError(t);
470470
}

‎client/src/test/java/org/asynchttpclient/netty/NettyConnectionResetByPeerTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ public void testAsyncHttpClientConnectionResetByPeer() throws InterruptedExcepti
4444
).get();
4545
} catch (ExecutionException e) {
4646
Throwable ex = e.getCause();
47-
assertThat(ex, is(not(instanceOf(TimeoutException.class))));
4847
assertThat(ex, is(instanceOf(IOException.class)));
49-
// assertTrue(ex.getMessage().equalsIgnoreCase("Connection reset by peer"));
5048
}
5149
}
5250

0 commit comments

Comments
 (0)
Please sign in to comment.