Fixed handling of ClientConnector promises.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
b5956b975d
commit
ec38e99630
|
@ -72,7 +72,7 @@ public abstract class AbstractConnectorHttpClientTransport extends AbstractHttpC
|
|||
context.put(ClientConnector.CLIENT_CONNECTION_FACTORY_CONTEXT_KEY, destination.getClientConnectionFactory());
|
||||
@SuppressWarnings("unchecked")
|
||||
Promise<Connection> promise = (Promise<Connection>)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, promise);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, Promise.from(ioConnection -> {}, promise::failed));
|
||||
connector.connect(address, context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ public class HTTP2Client extends ContainerLifeCycle
|
|||
public void connect(SocketAddress address, ClientConnectionFactory factory, Session.Listener listener, Promise<Session> promise, Map<String, Object> context)
|
||||
{
|
||||
context = contextFrom(factory, listener, promise, context);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, promise);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, Promise.from(ioConnection -> {}, promise::failed));
|
||||
connector.connect(address, context);
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ public class HTTP2Client extends ContainerLifeCycle
|
|||
public void accept(SocketChannel channel, ClientConnectionFactory factory, Session.Listener listener, Promise<Session> promise)
|
||||
{
|
||||
Map<String, Object> context = contextFrom(factory, listener, promise, null);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, promise);
|
||||
context.put(ClientConnector.CONNECTION_PROMISE_CONTEXT_KEY, Promise.from(ioConnection -> {}, promise::failed));
|
||||
connector.accept(channel, context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue