Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Jetty problem with content-length in 9.0.0.M5

I've been using maven jetty plugin version 9.0.0.M5

The milton.io webdav servlet generates a PROPFIND response XML and converts to a byte array. The length of this byte array is set as the content length header, and then the byte array is written to the outputstream, followed by a flush of the response outputstream

This causes an EOF exception

This servlet is in widespread use and I've been using with Jetty 6 without problem.

If i remove the call to out.flush() then the exception doesnt occur, and the client receives the response, but subsequent requests hang until the TCP socket times out - indicating a mismatch between the content length header set and actual content sent.

I then down-graded to jetty plugin 8.1.8.v20121106 and the servlet then works as expected - no EOF exceptions.

So it seems that jetty9 is adding an extra byte to the content sent, or something similar. Note the problem only occurs when setting an explicit content length. If i remove the content length header jetty uses chunked encoding correctly. However, not all webdav clients support chunked encoding.

Thanks,
Brad


Back to the top