From 23e7ec193b3346949d4f461eabedc288c477191c Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Thu, 18 Jan 2024 11:22:47 +0200 Subject: [PATCH] Obtain Http2FrameCodec context only when needed --- .../netty/http/client/Http2ConnectionProvider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionProvider.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionProvider.java index d565dea021..5a39747c44 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionProvider.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -343,10 +343,10 @@ public void onUncaughtException(Connection connection, Throwable error) { @Override public void operationComplete(Future future) { - Channel channel = pooledRef.poolable().channel(); - Http2Pool.Http2PooledRef http2PooledRef = http2PooledRef(pooledRef); - ChannelHandlerContext frameCodec = http2PooledRef.slot.http2FrameCodecCtx(); if (future.isSuccess()) { + Channel channel = pooledRef.poolable().channel(); + Http2Pool.Http2PooledRef http2PooledRef = http2PooledRef(pooledRef); + ChannelHandlerContext frameCodec = http2PooledRef.slot.http2FrameCodecCtx(); Http2StreamChannel ch = future.getNow(); if (!channel.isActive() || frameCodec == null ||