tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1599183 - in /tomcat/trunk: java/org/apache/coyote/http11/AbstractHttp11Processor.java test/org/apache/coyote/http11/TestAbstractHttp11Processor.java webapps/docs/changelog.xml
Date Mon, 02 Jun 2014 12:23:25 GMT
Author: markt
Date: Mon Jun  2 12:23:24 2014
New Revision: 1599183

URL: http://svn.apache.org/r1599183
Log:
Revert fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=56555 which, after further
discussion, was classed as INVALID.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1599183&r1=1599182&r2=1599183&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Mon Jun  2 12:23:24
2014
@@ -1478,8 +1478,11 @@ public abstract class AbstractHttp11Proc
         // Connection: close header.
         keepAlive = keepAlive && !statusDropsConnection(statusCode);
         if (!keepAlive) {
-            headers.setValue(Constants.CONNECTION).setString(
-                    Constants.CLOSE);
+            // Avoid adding the close header twice
+            if (!connectionClosePresent) {
+                headers.addValue(Constants.CONNECTION).setString(
+                        Constants.CLOSE);
+            }
         } else if (!http11 && !error) {
             headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
         }

Modified: tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java?rev=1599183&r1=1599182&r2=1599183&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java Mon Jun  2
12:23:24 2014
@@ -25,7 +25,6 @@ import java.net.Socket;
 import java.nio.CharBuffer;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 
@@ -54,45 +53,6 @@ import org.apache.tomcat.util.buf.ByteCh
 public class TestAbstractHttp11Processor extends TomcatBaseTest {
 
     @Test
-    public void testStatusForcesClose() throws Exception {
-        Tomcat tomcat = getTomcatInstance();
-
-        // Must have a real docBase - just use temp
-        Context ctxt = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
-
-        // Add protected servlet
-        Tomcat.addServlet(ctxt, "StatusForcesCloseServlet", new StatusForcesCloseServlet());
-        ctxt.addServletMapping("/*", "StatusForcesCloseServlet");
-
-        tomcat.start();
-
-        ByteChunk bc = new ByteChunk();
-        Map<String,List<String>> responseHeaders = new HashMap<>();
-        getUrl("http://localhost:" + getPort() + "/anything", bc, responseHeaders);
-
-        // Assumes header name uses standard case
-        List<String> values = responseHeaders.get("Connection");
-        Assert.assertEquals(1, values.size());
-        Assert.assertEquals("close", values.get(0).toLowerCase(Locale.ENGLISH));
-    }
-
-    private static class StatusForcesCloseServlet extends HttpServlet {
-
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
-
-            // Set the Connection header
-            resp.setHeader("Connection", "keep-alive");
-
-            // Set a status code that should force the connection to close
-            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-        }
-    }
-
-    @Test
     public void testWithTEVoid() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1599183&r1=1599182&r2=1599183&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun  2 12:23:24 2014
@@ -131,11 +131,6 @@
         processing. This fixes the Comet chat example. (markt)
       </fix>
       <fix>
-        <bug>56555</bug>: When Tomcat closes the connection based on the HTTP
-        status code of the response, ensure that only one connection header is
-        sent to the client. (markt)
-      </fix>
-      <fix>
         Fix input concurrency issue in NIO2 upgrade. (remm)
       </fix>
     </changelog>



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


Mime
View raw message