On Tue, 9 Apr 2002, Remy Maucherat wrote:

> > Can you add a small comment in Response and clearly indicate who should
> > call it - I'm fine with any, but we should do it consistenlty in the 2
> > adapters and in the 2 protocols.
> 
> The class which is implementing the Adapter interface is calling it in the
> TC 4 code.

Ok. I'll change  tomcat3 and revert the change on 4.0 ( and add a comment 
on adapter ). But first let's clarify how it's supposed to work, the 
current Tomcat4Adapter doesn't seem to call it - it calls 
Tomcat4Response.finish() but that didn't call Response.finish() before my 
patch. 


> outputBuffer.close();
> should COMMIT

There's no outputBuffer.close in the API - only in 4.0. 

Who should send the commit ? 


> coyoteResponse.finish();
> should CLOSE

Yes, but Tomcat4 Response finish() method didn't call 
coyoteResponse.finish(). 


> For the HTTP/1.1 protocol:
> - Committing twice is not ok.
> - Closing twice is not ok.

Of course, same for ajp or any other protocol. We should definitely commit
only once and close only once - the question is who is responsible for 
that. 

Coyote Response has a sendHeaders() method, which sets commited to true.
I think it should also call the COMMIT hook - if not the caller of 
sendHeaders() ( Tomcat4 or Tomcat3 Response ) must do it. ( before my
fix it wasn't true - the COMMIt was sent by http11 before the first write 
).

Also, Response has a finish() that calls CLOSE - but finish wasn't called
by tomcat4's Response, neither by the adapter ( which called 
response.finishResponse() - but on the tomcat4 response, which didn't 
propagate to the coyote.Response ).

Costin




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

Reply via email to