Hi,
Final result:
I tested it on jetty-distribution-9.1.2.v20140210, it works, thanks!
Response to the mail:
I added one line "// comment this line to test" into the code after I got the stack trace.
I ran it again on jetty 9.1.1 today, the log:
onWritePossible> asyncCtx=org.eclipse.jetty.server.AsyncContextState@673e6946, ready=true, written=false
onWritePossible> asyncCtx=org.eclipse.jetty.server.AsyncContextState@673e6946, ready=false, written=true
org.eclipse.jetty.io.EofException: Closed
at org.eclipse.jetty.server.HttpOutput$AsyncICB.completed(HttpOutput.java:725)
at org.eclipse.jetty.util.IteratingCallback.processIterations(IteratingCallback.java:200)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:126)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:270)
at java.io.OutputStream.write(OutputStream.java:75)
at TextWriteListener.onWritePossible(TextWriteListener.java:44)
at org.eclipse.jetty.server.HttpOutput.run(HttpOutput.java:690)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1159)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:335)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:722)
The stack trace was printed several seconds later than "onWritePossible> ...".
If I don't set Content-Length, then the output is:
onWritePossible> asyncCtx=org.eclipse.jetty.server.AsyncContextState@3271a79e, ready=true, written=false
onWritePossible> asyncCtx=org.eclipse.jetty.server.AsyncContextState@3271a79e, ready=true, written=true