tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [tomcat] ChristopherSchultz commented on a change in pull request #218: WIP: BZ 63835: Add support for Keep-Alive header
Date Wed, 23 Oct 2019 15:39:19 GMT
ChristopherSchultz commented on a change in pull request #218: WIP: BZ 63835: Add support for
Keep-Alive header
URL: https://github.com/apache/tomcat/pull/218#discussion_r338125259
 
 

 ##########
 File path: java/org/apache/coyote/http11/Http11Processor.java
 ##########
 @@ -915,8 +915,26 @@ protected final void prepareResponse() throws IOException {
                 headers.addValue(Constants.CONNECTION).setString(
                         Constants.CLOSE);
             }
-        } else if (!http11 && !getErrorState().isError()) {
-            headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+        } else if (!getErrorState().isError()) {
+            if (!http11) {
+                headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+            }
+
+            boolean connectionKeepAlivePresent =
+                isConnectionToken(request.getMimeHeaders(), Constants.KEEPALIVE);
+
+            if (connectionKeepAlivePresent) {
+                int keepAliveTimeout = protocol.getKeepAliveTimeout();
+
+                if (keepAliveTimeout > 0) {
 
 Review comment:
   Did we decide that supporting a non-standard response header was a good idea?
   
   Should we use `Constants.KEEP_ALIVE` (or even `Constants.KEEPALIVE`) for the string instead
of a string value, here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message