CorsHandler.write(...) should not cause a flush. (#7839)

Motivation:

Unnecessary flushes reduce the amount of flush coalescing that can happen at higher levels and thus can increase number of packets (because of TCP_NODELAY) and lower throughput (due to syscalls, TLS frames, etc)

Modifications:

Replace writeAndFlush(...) with write(...)

Result:

Fixes https://github.com/netty/netty/issues/7837.
This commit is contained in:
Norman Maurer 2018-04-03 21:11:51 +02:00 committed by GitHub
parent 473f6a6edb
commit ee9057ad99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,7 @@ public class CorsHandler extends ChannelDuplexHandler {
setExposeHeaders(response);
}
}
ctx.writeAndFlush(msg, promise);
ctx.write(msg, promise);
}
private static void forbidden(final ChannelHandlerContext ctx, final HttpRequest request) {