Skip to content

Commit

Permalink
[UNDERTOW-2249] Change that HttpClientConnection.sendRequest on a clo…
Browse files Browse the repository at this point in the history
…sed connection results in a ClosedChannelException instead of IOException
  • Loading branch information
xjusko committed Mar 6, 2024
1 parent 128b967 commit 44c410a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.io.IOException;
import java.net.URI;
import java.nio.channels.ClosedChannelException;

/**
* starting from 1000
Expand Down Expand Up @@ -58,7 +59,7 @@ public interface UndertowClientMessages {
IOException unknownTransferEncoding(String transferEncodingString);

@Message(id = 1033, value = "Invalid connection state")
IOException invalidConnectionState();
ClosedChannelException invalidConnectionState();

@Message(id = 1034, value = "Unknown AJP packet type %s")
IOException unknownAjpMessageType(byte packetType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -360,8 +361,7 @@ public void testSslServerIdentity() throws Exception {
latch.await(10, TimeUnit.SECONDS);

Assert.assertEquals(0, responses.size());
// see UNDERTOW-2249: assert exception instanceof ClosedChannelException
Assert.assertNotNull(exception);
Assert.assertTrue(exception instanceof ClosedChannelException);
} finally {
connection.getIoThread().execute(() -> IoUtils.safeClose(connection));
DefaultServer.stopSSLServer();
Expand Down

0 comments on commit 44c410a

Please sign in to comment.