Skip to content

Commit c342da9

Browse files
authored
Merge pull request #1455 from fl4via/UNDERTOW-2249
[UNDERTOW-2249] At ClientConnection, use ClosedChannelException to no…
2 parents 61953d2 + b5d53c9 commit c342da9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

core/src/main/java/io/undertow/client/ajp/AjpClientConnection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ public void sendRequest(final ClientRequest request, final ClientCallback<Client
240240
clientCallback.failed(UndertowClientMessages.MESSAGES.closedConnectionState());
241241
return;
242242
}
243+
if (anyAreSet(state, CLOSE_REQ | CLOSED)) {
244+
clientCallback.failed(new ClosedChannelException());
245+
return;
246+
}
243247
final AjpClientExchange AjpClientExchange = new AjpClientExchange(clientCallback, request, this);
244248
if (currentRequest == null) {
245249
initiateRequest(AjpClientExchange);

core/src/main/java/io/undertow/client/http/HttpClientConnection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ public void sendRequest(final ClientRequest request, final ClientCallback<Client
355355
clientCallback.failed(UndertowClientMessages.MESSAGES.closedConnectionState());
356356
return;
357357
}
358+
if (anyAreSet(state, CLOSE_REQ | CLOSED)) {
359+
clientCallback.failed(new ClosedChannelException());
360+
return;
361+
}
358362
final HttpClientExchange httpClientExchange = new HttpClientExchange(clientCallback, request, this);
359363
boolean ssl = this.connection instanceof SslConnection;
360364
if(!ssl && !http2Tried && options.get(UndertowOptions.ENABLE_HTTP2, UndertowOptions.DEFAULT_ENABLE_HTTP2) && !request.getRequestHeaders().contains(Headers.UPGRADE)) {

0 commit comments

Comments
 (0)