Ryan Lubke wrote:
> 
> You can send me the Watchdog patches and I'll look them over.
> 

My original failed tests turned out to be my fault. I
didn't update my servlet-test.war. I downgraded the
severity of 9794 from "Blocker" to "Normal", since it
turns out there really are problems.

The Watchdog GTest "HTTP" engine reads body content
through a filter that maps CRLF into a single LF. That
means a golden file (which uses plain LF as EOL) can be
compared with a response that was generated using
PrintWriter.println() on an O/S that uses either LF or
CRLF as EOL. That leads to some weirdness.

First off, systems that use plain CR as EOL, like old
Macs, will presumably fail tests. That isn't such a big
deal, because old Macs don't run Java 2, but it isn't good
for a conformance testing tool to have that sort or
problem built in.

More importantly, systems that use single char EOL's are
now generating illegal HTTP but still passing the
tests. For example, on Unix, the SetContentLength servlet
indicates a content-length of 33 but only sends 32
characters. This works because all the tests are currently
hardcoded to be HTTP/1.0, which closes the stream at the
end of the body. But's it's wrong. Try:

  $ wget http://localhost:8080/servlet-tests/SetContentLengthTest

Long term, Watchdog probably needs to move to a proper
HTTP client library.

Medium term the places where Watchdog servlets use
println("data") need to be changed to use
print(data+"\r\n") or print(data+"\n") or whatever, as
long as they do it consistently, and the number of magic
constants needs to be minimzied.

Short term, I fixed SetContentLengthTestServlet and
ServletResponseWrapperSetContentLengthTestServlet to both
hardcode CRLF instead of depending on println(). (see the
attached patches)

I'd like to get rid of the mystery constants "2" and "48",
but that would involve a further rewrite, and I wanted to
hold off until there was some discussion about the
appropriate med/long term solution.


-- 
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

Attachment: sclt_eol.patch
Description: Binary data

Attachment: srwsclt_eol.patch
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to