jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.8k stars 1.9k forks source link

Throw warning if ServletInputStream.transferTo(OutputStream) is used while in Async ReadListener is in use? #11663

Open joakime opened 3 months ago

joakime commented 3 months ago

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.

joakime commented 3 months ago

This is a topic opened up at the Servlet spec at https://github.com/jakartaee/servlet/issues/301