jetty.project
jetty.project copied to clipboard
Throw warning if ServletInputStream.transferTo(OutputStream) is used while in Async ReadListener is in use?
Jetty version(s) 12.0.8
Enhancement Description
If a Servlet is in an active ReadListener mode (Async Read), and there is code that attempts to use ServletInputStream.transferTo() style methods (that result in multiple read attempts) then it I think using that method should throw an IllegalStateException indicating that this method is unsupported during ReadListener operations.
This is a topic opened up at the Servlet spec at https://github.com/jakartaee/servlet/issues/301
We have now followed the behavior suggested in https://github.com/jakartaee/servlet/issues/301 from jetty 12 onwards.
This means that all the methods like transferTo and skipN will ultimately call read, which if is in async mode will ultimately throw java.lang.IllegalStateException: read on unready input if it cannot progress.