H2 async runtime to proactively set HTTP/2 protocol version in the execution context

This commit is contained in:
Oleg Kalnichevski 2022-09-11 18:47:31 +02:00
parent 3fe6a8bcdf
commit ed7701c509

View File

@ -40,6 +40,7 @@
import org.apache.hc.core5.concurrent.ComplexCancellable;
import org.apache.hc.core5.concurrent.FutureCallback;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.HttpVersion;
import org.apache.hc.core5.http.nio.AsyncClientExchangeHandler;
import org.apache.hc.core5.http.nio.AsyncPushConsumer;
import org.apache.hc.core5.http.nio.HandlerFactory;
@ -101,6 +102,7 @@ public void completed(final IOSession ioSession) {
if (log.isDebugEnabled()) {
log.debug("{} acquired endpoint", id);
}
context.setProtocolVersion(HttpVersion.HTTP_2);
callback.completed(InternalH2AsyncExecRuntime.this);
}