Commit 74565cfe authored by Johan Forsell's avatar Johan Forsell

Make sure to complete context if an exception is thrown when setting read listener.

parent 2638e753
......@@ -149,7 +149,12 @@ public class HttpBindServlet extends HttpServlet {
final AsyncContext context = request.startAsync();
// Asynchronously reads the POSTed input, then triggers #processContent.
request.getInputStream().setReadListener(new ReadListenerImpl(context));
try {
request.getInputStream().setReadListener(new ReadListenerImpl(context));
} catch (IllegalStateException e) {
Log.warn("Error when setting read listener", e);
context.complete();
}
}
protected void processContent(AsyncContext context, String content)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment