DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4942>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4942

Setting the HTTP "Connection" header to "close" does not take affect by a servlet

           Summary: Setting the HTTP "Connection" header to "close" does not
                    take affect by a servlet
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HTTP/1.1 Connector
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


Setting the HTTP "Connection" header to "close" does not take affect by a Java 
servlet.  Note that this servlet sets all response header fields (including 
the "Connection" and "Content-Length" fields) before writing out the response 
body via the servlet output stream.

It appears that the 
org.apache.catalina.connector.http.HttpResponseStream#checkChunking
(HttpResponseImpl) method arbitrarily removes the "Connection" header if 
chunking should not be done; however, this prevents the servlet from forcing 
the current connection to close after the processing is completed.

It seems reasonable for servlets to specify to close the current connection.  
Possible uses might be to help combat denial-of-service attacks, for example.

My particular motivation for closing the connection is because clients to my 
servlet (a Java application) in general try to re-use the connection to the 
servlet as much as possible (so the clients will never on their own "release" 
the connection and use a new one).  My servlet, therefore, would like to be 
able to close the current connection when a max count is reached for a 
particular HTTP session so that the corresponding client would use a new 
connection, and ultimately our server-side system will be free to handle more 
quasi-concurrent clients than otherwise.  (Even though the client has a config 
parameter to limit the number of HTTP requests/responses over a single socket 
connection, we would like to have more control and force a maximum on the 
server-side.)

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

Reply via email to