Fixed session bootstrap for updated version of netty

This commit is contained in:
nathan 2020-05-08 01:16:46 +02:00
parent ee07b10e82
commit 15be442cb2
1 changed files with 2 additions and 14 deletions

View File

@ -214,20 +214,8 @@ class SessionBootstrap extends AbstractBootstrap<SessionBootstrap, Channel> {
@Override
void init(Channel channel) throws Exception {
final Map<ChannelOption<?>, Object> options = options0();
synchronized (options) {
setChannelOptions(channel, options, logger);
}
final Map<AttributeKey<?>, Object> attrs = attrs0();
synchronized (attrs) {
for (Entry<AttributeKey<?>, Object> e : attrs.entrySet()) {
@SuppressWarnings("unchecked")
AttributeKey<Object> key = (AttributeKey<Object>) e.getKey();
channel.attr(key)
.set(e.getValue());
}
}
setChannelOptions(channel, options0().entrySet().toArray(EMPTY_OPTION_ARRAY), logger);
setAttributes(channel, attrs0().entrySet().toArray(EMPTY_ATTRIBUTE_ARRAY));
ChannelPipeline p = channel.pipeline();