public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
LOG.warn("Exception thrown while processing request", cause);
ctx.close();
}
private long returnLength(final long offset, final long len, final long fileLength) {
<BUG>if (len == -1) {
return fileLength - offset;
} else {
return len;
}</BUG>
}

public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
LOG.warn("Exception thrown while processing request", cause);
ctx.close();
