Skip to content

Commit

Permalink
fix merge error/build error (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinChenYan committed Mar 1, 2023
1 parent f2a793a commit ef7f18c
Showing 1 changed file with 3 additions and 12 deletions.
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

0 comments on commit ef7f18c

Please sign in to comment.