https://bz.apache.org/bugzilla/show_bug.cgi?id=58463
Bug ID: 58463 Summary: Servlet 3.1 ServletInputStream.setReadListener should not gate on asynchronous state Product: Tomcat 8 Version: trunk Hardware: All OS: All Status: NEW Severity: major Priority: P2 Component: Specification APIs Assignee: dev@tomcat.apache.org Reporter: cjbo...@gmail.com Created attachment 33150 --> https://bz.apache.org/bugzilla/attachment.cgi?id=33150&action=edit Fix ServletInputStream.setReadListener implementation The implementation of ServletInputStream.setReadListener incorrectly gates on the current state of the request. In org.apache.coyote.Request the setReadListener method checks that asynchronous processing has been started. This is an incorrect interpretation of the specification. It should be possible to attach a readListener to the stream even if the request is not operating in asynchronous mode. This is particularly malicious as it causes IllegalState exceptions to be thrown by tomcat when asynchronous processing is managed separately to the attaching of readListeners. An application that attaches a readListener to a stream, and later switches the request to asynchronous mode, will not work in tomcat. I have attached a patch that removes this gate. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org