-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
netty-in-action/chapter12/src/main/java/nia/chapter12/HttpRequestHandler.java
Lines 63 to 68 in 68e95e2
if (ctx.pipeline().get(SslHandler.class) == null) { | |
ctx.write(new DefaultFileRegion( | |
file.getChannel(), 0, file.length())); | |
} else { | |
ctx.write(new ChunkedNioFile(file.getChannel())); | |
} |
ctx.pipeline().get(SslHandler.class) == null
checks whether HTTPS is enabled.
The difference between new DefaultFileRegion(file.getChannel(), 0, file.length())
and new ChunkedNioFile((file.getChannel()))
is that the previous one would use zero-copy optimization, which is beneficial to performance if possible.
But how shall the protocol(TLS or not) determine the usage of optimization?
Metadata
Metadata
Assignees
Labels
No labels