Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix merge error/build error #1638

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 3 additions & 12 deletions client/src/main/java/com/networknt/client/Http2Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class Http2Client {
static String MASK_KEY_TRUST_STORE_PASS = "trustStorePass";
static String MASK_KEY_KEY_STORE_PASS = "keyStorePass";
static String MASK_KEY_KEY_PASS = "keyPass";
static boolean isHttp2 = ClientConfig.get().getRequestEnableHttp2();


// TokenManager is to manage cached jwt tokens for this client.
private TokenManager tokenManager = TokenManager.getInstance();
Expand Down Expand Up @@ -231,16 +231,7 @@ public ClientConnection getFutureConnection(long timeoutSeconds, IoFuture<Client

return connection;
}

/**
* This is the method to override the enableHttp2 value. The default is from client config.
*
* @param enableHttp2 client request to server is http2 or not
*/
public void setEnableHttp2(boolean enableHttp2) {
isHttp2 = enableHttp2;
}


public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) {
return connect(uri, worker, null, bufferPool, options);
}
Expand Down Expand Up @@ -1242,7 +1233,7 @@ public CompletableFuture<ClientResponse> callService(String protocol, String ser
public CompletableFuture<ClientConnection> connectAsync(URI uri) {
if("https".equals(uri.getScheme()) && SSL == null) SSL = getDefaultXnioSsl();
return this.connectAsync(null, uri, WORKER, SSL, com.networknt.client.Http2Client.BUFFER_POOL,
isHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true) : OptionMap.EMPTY);
ClientConfig.get().getRequestEnableHttp2() ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true) : OptionMap.EMPTY);
}

/**
Expand Down