IoUtils.safeClose(channel);
return;
}
buffer.getResource().flip();
if(selected != null) {
DelegateOpenListener listener = listeners.get(selected).listener;
source.getReadSetter().set(null);
listener.handleEvent(channel, buffer);
free = false;
return;
} else if(res > 0) {
if(fallbackProtocol == null) {
UndertowLogger.REQUEST_IO_LOGGER.noALPNFallback(channel.getPeerAddress());
IoUtils.safeClose(channel);
return;
}
DelegateOpenListener listener = listeners.get(fallbackProtocol).listener;
source.getReadSetter().set(null);
listener.handleEvent(channel, buffer);
free = false;
return;
} else if (res == 0) {
channel.getSourceChannel().resumeReads();
return;