Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public boolean remove(Object o) {
}

if (maxConnectionsPerHostEnabled) {
freeChannelsPerHost = new ConcurrentHashMap<String, Semaphore>();
channelId2KeyPool = new ConcurrentHashMap<Integer, String>();
freeChannelsPerHost = new ConcurrentHashMap<>();
channelId2KeyPool = new ConcurrentHashMap<>();
} else {
freeChannelsPerHost = null;
channelId2KeyPool = null;
Expand Down Expand Up @@ -381,8 +381,11 @@ public void abortChannelPreemption(String poolKey) {
getFreeConnectionsForHost(poolKey).release();
}

public void registerOpenChannel(Channel channel) {
public void registerOpenChannel(Channel channel, final String poolKey) {
openChannels.add(channel);
if (maxConnectionsPerHostEnabled) {
channelId2KeyPool.put(channel.getId(), poolKey);
}
}

private HttpClientCodec newHttpClientCodec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void writeRequest(Channel channel, String poolKey) {
if (future.getAsyncHandler() instanceof AsyncHandlerExtensions)
AsyncHandlerExtensions.class.cast(future.getAsyncHandler()).onConnectionOpen();

channelManager.registerOpenChannel(channel);
channelManager.registerOpenChannel(channel, poolKey);
future.attachChannel(channel, false);
requestSender.writeRequest(future, channel);
}
Expand Down