Closed georgeOsdDev closed 5 years ago
Thanks for reporting this serious bug!
val endIndex2 = if (endIndex >= 0) Math.min(endIndex, raf.length - 1) else raf.length - 1
I think we should also check startIndex
. Can you create a pull request?
I created PR #676.
This PR also add 416 REQUESTED RANGE NOT SATISFIABLE for invalid startIndex
.
DefaultFileRegion.transferTo never end
Essentially it seems to be a matter of Netty(or sun.nio.ch.FileChannelImpl?). So CPU usage increase bug is potentially left.
Thanks, I've merged the PR. I'll release a new version very soon.
Maybe I'll improve the code a little bit (adding test).
Essentially it seems to be a matter of Netty(or sun.nio.ch.FileChannelImpl?).
Yes, it's a potential risk. Maybe Netty can do a check, before calling sun.nio.ch.FileChannelImpl.transferTo
.
Thanks 🙏 🙏 🙏
I'll release a new version very soon.
I've just released version 3.28.16: https://groups.google.com/forum/#!topic/xitrum-framework/DVBHlfxtywc
Thanks for reporting and fixing.
Netty team fixed at 4.1.34.Final netty/netty#8868 netty/netty#8885
Xitrum version: 3.28.15
Reproduce step: Create public file request with invalid(bigger than real file size) range header.
https://github.com/xitrum-framework/xitrum/blob/master/src/main/scala/xitrum/handler/outbound/XSendFile.scala#L180
operationComplete
on this line will never called becauseDefaultFileRegion.transferTo
never end.thread dump
https://github.com/xitrum-framework/xitrum/blob/master/src/main/scala/xitrum/handler/outbound/XSendFile.scala#L141 This line should be like below?