jakarta-watchdog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: OK, What Gives?
Date Sat, 02 Dec 2000 01:47:48 GMT


"vanitha.venkatraman" wrote:

> Craig,
> So, this is what is happening:
>
> With Tomcat-4.0-20001129 and Tomcat-4.0-20001130 builds, the Watchdog tests do
> not run, they hang for all targets (all, jsp, jsp-xml, gtestservlet). I could
> execute the jsps manually from the browser. So, the war files get deployed on
> the server. But the tests do not work from GTest. No idea why this is
> happening. GTest has not changed in a while.
>
> I went as far behind as jakarta-tomcat-4.0-20001103 build and all the Watchdog
> tests WORK. They execute for all targets.
>

After a bunch of hours, I discovered what is actually happening, and what I suggest we do
about it.

The HTTP spec says that the request line, and the headers, should be terminated by CR+LF.
 The current implementation of the HTTP/1.1 connector in Tomcat
4.0 (20001130) is strict about enforcing this -- if a client sends a line terminated with
just LF instead, it will hang forever, waiting for the CR.  (Note
to Remy -- the test connector works fine -- it must be tolerant of this case).

I looked at the source code for GTest.  In order to send data, it wraps a PrintWriter around
the output stream for the socket, and generates output like
this, where "request" is the request line to be sent:

    PrintWriter pw = new PrintWriter(out);
    ...
    pw.println(request);

On a Windows system, println() will append "\r\n" to this line, so if you run the GTest client
on a Windows box, everything works fine.  However, if you
run it on a Unix box, as I was doing, it only appends "\n", and everything comes to a screeching
halt.

I modified a local copy of GTest to make the above line look like this:

    pw.print(request + "\r\n");

instead, and it works fine on both Unix and Windows systems.

Here is what I suggest we do:

* I propose that Tomcat be modified to be tolerant of request lines
  and header lines that end with LF instead of CR+LF.  The HTTP/1.1
  spec suggests this in section 19.3.  Remy, could you make this
  change please?

* I propose to check in my modified version of GTest.  It is not reasonable
  for the test suite to assume that the server under test is tolearant of
  this kind of spec violation.  Is that OK with you, Vanitha?

>
> --Vanitha

Craig McClanahan



Mime
View raw message