From: <php...@li...> - 2010-03-08 17:02:27
|
The problem is that jetty doesn't flush the response buffer. In pseudo code: protected void doPut (HttpServletRequest req, HttpServletResponse res) { res.getOutputStream().write(1); res.setContentLength(1); try {res.flushBuffer(); } catch (Exception t) {t.printStackTrace(); } try {resOut.close(); } catch (Exception t) {t.printStackTrace(t);} // response must be flushed right here, not at the end of the service() routine Thread.wait(15000); } > Connection:keep-alive It's a HTTP/1.0 request. If jetty sets keep-alive for a HTTP/1.0 request, we've found another bug, I think. BTW: Jetty contains another serious bug: requestDispatcher.include(req, res); If req is an instance of HttpServletRequestWrapper, jetty tries to find the original request in the thread context. This fails if the current thread is not a servlet thread. You can verify this bug by clicking on the jsr223.jsp example of the JavaBridge.war; jetty crashes with a NullPointerException. Regards, Jost Bökemeier On 3/8/10, php...@li... <php...@li...> wrote: > I filled a bug with Eclipse and I was asked: > > "Greg Wilkins 2010-03-05 02:27:12 EST > Can you give a bit more information about the request that is not being > flushed. > > Does the response have Connection:keep-alive set and a Content-Length?" > > Do you know the answer? I'll update the bug report. > > Thanks, > > McKinley > > On Fri, Feb 19, 2010 at 5:52 AM, > <php...@li...> wrote: >> This is indeed a Jetty 7 bug. Jetty doesn't flush the output buffer >> "res.flushBuffer()" for HTTP/1.0 connections, so the code runs into a >> wait timeout. I won't change the bridge code to work around this bug. >> But Jetty 7.0 supports HTTP/1.1 chunked connections: >> >> Please add >> >> <context-param> >> <param-name>promiscuous</param-name> >> <param-value>true</param-value> >> </context-param> >> >> after the </listener> declration of your WEB-INF/web.xml to work around >> this Jetty 7 bug. >> >> >> Regards, >> Jost Bökemeier >> > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |