Skip to content

Commit

Permalink
Added missing #disconnectEndpoint method to AsyncConnectExec
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2c committed Nov 30, 2023
1 parent 8a2b0f5 commit a46c9e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ Cancellable connectEndpoint(
HttpClientContext context,
FutureCallback<AsyncExecRuntime> callback);

/**
* Disconnects the local endpoint from the initial hop in the connection route.
*/
void disconnectEndpoint();

/**
* Upgrades transport security of the active connection by using the TLS security protocol.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ public void cancelled() {

}

@Override
public void disconnectEndpoint() {
final Endpoint endpoint = sessionRef.get();
if (endpoint != null) {
endpoint.session.close(CloseMode.GRACEFUL);
}
}

@Override
public void upgradeTls(final HttpClientContext context) {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ public void completed(final AsyncConnectionEndpoint endpoint) {

}

@Override
public void disconnectEndpoint() {
final AsyncConnectionEndpoint endpoint = endpointRef.get();
if (endpoint != null) {
endpoint.close(CloseMode.GRACEFUL);
}
}

@Override
public void upgradeTls(final HttpClientContext context) {
upgradeTls(context, null);
Expand Down

0 comments on commit a46c9e5

Please sign in to comment.