[Bug 56907] New: Threads leak

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56907

Bug ID: 56907
   Summary: Threads leak
   Product: Tomcat 8
   Version: 8.0.11
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: gaponen...@haulmont.com

Hello.

While using WebSocket implementation of versions 7.0.55 and 8.0.11 leaking
threads were noticed. 
Use method WsWebSocketContainer.connection (endpoint,
clientEndpointConfiguration, path) to reproduce this issue. 
The URL to specify a non-existent page. As a result, the connection will return
an error "404 Not Found", but the threads that have been created in the class
AsyncChannelWrapperSecure will stay alive for a long time (source of threads
creation: private final ExecutorService executor = Executors.newFixedThreadPool
(2, new SecureIOThreadFactory ());). 
Count of threads are increasing with every reconnect attempt to non-existent
URL.
Those will live for a very long time, until you disable the application that
calls the connection WsWebSocketContainer.connection (...). 
Leakage threads can be observed using the jvisualvm program. 

Please, make it possible to deal with such kind of situations and destroy
unused threads.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



Re: [VOTE] Release Apache Tomcat 8.0.12

2014-09-02 Thread Rémy Maucherat
2014-08-30 17:34 GMT+02:00 Mark Thomas :

> The proposed 8.0.12 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.0.12
>
> Rémy


svn commit: r1621972 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 12:58:24 2014
New Revision: 1621972

URL: http://svn.apache.org/r1621972
Log:
Refactor test to make it easier to test multiple cookie parsers

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621972&r1=1621971&r2=1621972&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
12:58:24 2014
@@ -24,6 +24,8 @@ import javax.servlet.http.Cookie;
 import org.junit.Assert;
 import org.junit.Test;
 
+import org.apache.tomcat.util.buf.MessageBytes;
+
 public class TestCookies {
 private Cookie FOO = new Cookie("foo", "bar");
 private Cookie BAR = new Cookie("bar", "rab");
@@ -195,9 +197,12 @@ public class TestCookies {
 }
 
 private void test(String header, Cookie... expected) {
-Cookies cookies = new Cookies(null);
+MimeHeaders mimeHeaders = new MimeHeaders();
+Cookies cookies = new Cookies(mimeHeaders);
+MessageBytes cookieHeaderValue = mimeHeaders.addValue("Cookie");
 byte[] bytes = header.getBytes(StandardCharsets.UTF_8);
-cookies.processCookieHeader(bytes, 0, bytes.length);
+cookieHeaderValue.setBytes(bytes, 0, bytes.length);
+// Calling getCookieCount() triggers parsing
 Assert.assertEquals(expected.length, cookies.getCookieCount());
 for (int i = 0; i < expected.length; i++) {
 Cookie cookie = expected[i];



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



svn commit: r1621975 - in /tomcat/trunk: java/org/apache/jasper/servlet/JspServletWrapper.java test/org/apache/jasper/runtime/TestPageContextImpl.java test/webapp/jsp/pageContext1.jsp test/webapp/jsp/

2014-09-02 Thread violetagg
Author: violetagg
Date: Tue Sep  2 13:11:20 2014
New Revision: 1621975

URL: http://svn.apache.org/r1621975
Log:
According to JavaDoc javax.servlet.jsp.PageContext.include(String) and 
javax.servlet.jsp.PageContext.include(String, boolean) must throw IOException 
if I/O error occur during the operation.
When JSPServlet init parameter "development" is "false" then IOException is 
re-thrown, but when the parameter is "true", JasperException is thrown instead 
of IOException.
This change guarantees that IOException is always re-thrown.

Added:
tomcat/trunk/test/webapp/jsp/pageContext1.jsp
tomcat/trunk/test/webapp/jsp/pageContext2.jsp
Modified:
tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
tomcat/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1621975&r1=1621974&r2=1621975&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Tue Sep  
2 13:11:20 2014
@@ -456,8 +456,8 @@ public class JspServletWrapper {
 }
 throw ex;
 } catch (IOException ex) {
-if(options.getDevelopment()) {
-throw handleJspException(ex);
+if (options.getDevelopment()) {
+throw new IOException(handleJspException(ex).getMessage(), ex);
 }
 throw ex;
 } catch (IllegalStateException ex) {

Modified: tomcat/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java?rev=1621975&r1=1621974&r2=1621975&view=diff
==
--- tomcat/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java 
(original)
+++ tomcat/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java Tue 
Sep  2 13:11:20 2014
@@ -80,6 +80,38 @@ public class TestPageContextImpl extends
 Assert.assertTrue(result.contains("OK"));
 }
 
+@Test
+public void testIncludeThrowsIOException() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File("test/webapp");
+tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+tomcat.start();
+
+ByteChunk res = new ByteChunk();
+
+int rc = getUrl("http://localhost:"; + getPort() + 
"/test/jsp/pageContext1.jsp", res, null);
+
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+
+String body = res.toString();
+Assert.assertTrue(body.contains("OK"));
+Assert.assertFalse(body.contains("FAILED"));
+
+res = new ByteChunk();
+
+rc = getUrl("http://localhost:"; + getPort() + 
"/test/jsp/pageContext1.jsp?flush=true", res,
+null);
+
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+
+body = res.toString();
+Assert.assertTrue(body.contains("Flush"));
+Assert.assertTrue(body.contains("OK"));
+Assert.assertFalse(body.contains("FAILED"));
+}
+
 public static class Bug56010 extends HttpServlet {
 
 private static final long serialVersionUID = 1L;

Added: tomcat/trunk/test/webapp/jsp/pageContext1.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/jsp/pageContext1.jsp?rev=1621975&view=auto
==
--- tomcat/trunk/test/webapp/jsp/pageContext1.jsp (added)
+++ tomcat/trunk/test/webapp/jsp/pageContext1.jsp Tue Sep  2 13:11:20 2014
@@ -0,0 +1,39 @@
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%@ page import="java.io.IOException" contentType="text/plain"%>
+<%
+boolean flush = Boolean.valueOf(request.getParameter("flush"));
+if (pageContext != null) {
+try {
+if (flush) {
+out.println("Flush");
+pageCont

Re: svn commit: r1621975 - in /tomcat/trunk: java/org/apache/jasper/servlet/JspServletWrapper.java test/org/apache/jasper/runtime/TestPageContextImpl.java test/webapp/jsp/pageContext1.jsp test/webapp/

2014-09-02 Thread Rémy Maucherat
2014-09-02 15:11 GMT+02:00 :

> Author: violetagg
> Date: Tue Sep  2 13:11:20 2014
> New Revision: 1621975
>
> URL: http://svn.apache.org/r1621975
> Log:
> According to JavaDoc javax.servlet.jsp.PageContext.include(String) and
> javax.servlet.jsp.PageContext.include(String, boolean) must throw
> IOException if I/O error occur during the operation.
> When JSPServlet init parameter "development" is "false" then IOException
> is re-thrown, but when the parameter is "true", JasperException is thrown
> instead of IOException.
> This change guarantees that IOException is always re-thrown.
>

The purpose of the JSPException is to give debug information to be able to
print out the details of the error. I am sorry Jasper will not pass the TCK
in dev mode, but likely this must remain as is. Unless you took care of
that somehow, this will likely have to be -1ed.

Rémy


svn commit: r1621982 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:40:43 2014
New Revision: 1621982

URL: http://svn.apache.org/r1621982
Log:
Initial implementation of RFC2109 parser

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1621982&r1=1621981&r2=1621982&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
13:40:43 2014
@@ -47,12 +47,16 @@ public class Cookie {
 StringManager.getManager("org.apache.tomcat.util.http.parser");
 
 private static final boolean isCookieOctet[] = new boolean[256];
+private static final boolean isText[] = new boolean[256];
 private static final byte[] VERSION_BYTES = 
"$Version".getBytes(StandardCharsets.ISO_8859_1);
+private static final byte[] PATH_BYTES = 
"$Path".getBytes(StandardCharsets.ISO_8859_1);
+private static final byte[] DOMAIN_BYTES = 
"$Domain".getBytes(StandardCharsets.ISO_8859_1);
 private static final byte[] EMPTY_BYTES = new byte[0];
 private static final byte TAB_BYTE = (byte) 0x09;
 private static final byte SPACE_BYTE = (byte) 0x20;
 private static final byte QUOTE_BYTE = (byte) 0x22;
 private static final byte COMMA_BYTE = (byte) 0x2C;
+private static final byte FORWARDSLASH_BYTE = (byte) 0x2F;
 private static final byte SEMICOLON_BYTE = (byte) 0x3B;
 private static final byte EQUALS_BYTE = (byte) 0x3D;
 private static final byte SLASH_BYTE = (byte) 0x5C;
@@ -70,6 +74,13 @@ public class Cookie {
 isCookieOctet[i] = true;
 }
 }
+for (int i = 0; i < 256; i++) {
+if (i < 0x21 || i == DEL_BYTE) {
+isText[i] = false;
+} else {
+isText[i] = true;
+}
+}
 }
 
 
@@ -118,7 +129,11 @@ public class Cookie {
 if (value != null && value.remaining() == 1) {
 if (value.get() == (byte) 49) {
 // $Version=1 -> RFC2109
-parseCookieRfc2109(bb, serverCookies);
+skipLWS(bb);
+byte b = bb.get();
+if (b == SEMICOLON_BYTE || b == COMMA_BYTE) {
+parseCookieRfc2109(bb, serverCookies);
+}
 return;
 } else {
 // Unrecognised version.
@@ -134,6 +149,37 @@ public class Cookie {
 }
 
 
+public static String unescapeCookieValueRfc2109(String input) {
+if (input == null || input.length() < 2) {
+return input;
+}
+if (input.charAt(0) != '"' && input.charAt(input.length() - 1) != '"') 
{
+return input;
+}
+
+StringBuilder sb = new StringBuilder(input.length());
+char[] chars = input.toCharArray();
+boolean escaped = false;
+
+for (int i = 1; i < input.length() - 1; i++) {
+if (chars[i] == '\\') {
+escaped = true;
+} else if (escaped) {
+escaped = false;
+if (chars[i] < 128) {
+sb.append(chars[i]);
+} else {
+sb.append('\\');
+sb.append(chars[i]);
+}
+} else {
+sb.append(chars[i]);
+}
+}
+return sb.toString();
+}
+
+
 private static void parseCookieRfc6265(ByteBuffer bb, ServerCookies 
serverCookies) {
 
 boolean moreToProcess = true;
@@ -181,14 +227,147 @@ public class Cookie {
 sc.getValue().setBytes(value.array(), value.position(), 
value.remaining());
 }
 }
-
 }
 }
 
 
 private static void parseCookieRfc2109(ByteBuffer bb, ServerCookies 
serverCookies) {
-System.out.println("Parse with RFC 2109");
-// TODO
+
+boolean moreToProcess = true;
+
+while (moreToProcess) {
+skipLWS(bb);
+
+boolean parseAttributes = true;
+
+ByteBuffer name = readToken(bb);
+ByteBuffer value = null;
+ByteBuffer path = null;
+ByteBuffer domain = null;
+
+skipLWS(bb);
+
+SkipResult skipResult = skipByte(bb, EQUALS_BYTE);
+if (skipResult == SkipResult.FOUND) {
+skipLWS(bb);
+value = readCookieValueRfc2109(bb, false);
+if (value == null) {
+logInvalidHeader(bb);
+// Invalid cookie value. Skip to the next semi-colon
+skipUntilSemiColon(bb);
+continue;
+}
+skipLWS(bb);
+}
+
+

svn commit: r1621984 - /tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:40:58 2014
New Revision: 1621984

URL: http://svn.apache.org/r1621984
Log:
Add a performance test for non-RFC2109 cookies (which nearly all will
be)

Added:
tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java 
  (with props)

Added: 
tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java?rev=1621984&view=auto
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java 
(added)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java 
Tue Sep  2 13:40:58 2014
@@ -0,0 +1,75 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomcat.util.http;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import org.apache.tomcat.util.buf.MessageBytes;
+
+public class TesterCookiesPerformance {
+
+@Test
+public void testPerformance01() throws Exception {
+final int cookieCount = 100;
+final int parsingLoops = 20;
+
+MimeHeaders mimeHeaders = new MimeHeaders();
+
+StringBuilder cookieHeader = new StringBuilder();
+// Create cookies
+for (int i = 0; i < cookieCount; i++) {
+cookieHeader.append("name");
+cookieHeader.append(i);
+cookieHeader.append('=');
+cookieHeader.append("value");
+cookieHeader.append(i);
+cookieHeader.append(';');
+}
+
+byte[] cookieHeaderBytes = cookieHeader.toString().getBytes("UTF-8");
+
+MessageBytes headerValue = mimeHeaders.addValue("Cookie");
+headerValue.setBytes(cookieHeaderBytes, 0, cookieHeaderBytes.length);
+
+Cookies cookies = new Cookies(mimeHeaders);
+// warm up
+for (int i = 0; i < parsingLoops; i++) {
+Assert.assertEquals(cookieCount, cookies.getCookieCount());
+cookies.recycle();
+}
+
+long oldStart = System.nanoTime();
+for (int i = 0; i < parsingLoops; i++) {
+cookies.setUseRfc6265(false);
+Assert.assertEquals(cookieCount, cookies.getCookieCount());
+cookies.recycle();
+}
+long oldDuration = System.nanoTime() - oldStart;
+
+long newStart = System.nanoTime();
+for (int i = 0; i < parsingLoops; i++) {
+cookies.setUseRfc6265(true);
+Assert.assertEquals(cookieCount, cookies.getCookieCount());
+cookies.recycle();
+}
+long newDuration = System.nanoTime() - newStart;
+
+System.out.println("Old duration: " + oldDuration);
+System.out.println("New duration: " + newDuration);
+}
+}

Propchange: 
tomcat/trunk/test/org/apache/tomcat/util/http/TesterCookiesPerformance.java
--
svn:eol-style = native



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



svn commit: r1621985 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:02 2014
New Revision: 1621985

URL: http://svn.apache.org/r1621985
Log:
Expand unit tests to cover old and new implementation

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621985&r1=1621984&r2=1621985&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:02 2014
@@ -28,177 +28,376 @@ import org.apache.tomcat.util.buf.Messag
 
 public class TestCookies {
 private Cookie FOO = new Cookie("foo", "bar");
+private Cookie FOO_NULL = new Cookie("foo", null);
+private Cookie FOO_EMPTY = new Cookie("foo", "");
 private Cookie BAR = new Cookie("bar", "rab");
+private Cookie BAR_NULL = new Cookie("bar", null);
 private Cookie A = new Cookie("a", "b");
+private Cookie HASH_NULL = new Cookie("#", null);
 
 @Test
-public void testBasicCookie() {
-test("foo=bar; a=b", FOO, A);
-test("foo=bar;a=b", FOO, A);
-test("foo=bar;a=b;", FOO, A);
-test("foo=bar;a=b; ", FOO, A);
-test("foo=bar;a=b; ;", FOO, A);
+public void testBasicCookieOld() {
+doTestBasicCookie(false);
 }
 
 @Test
-public void testNameOnlyAreDropped() {
-test("foo=;a=b; ;", A);
-test("foo;a=b; ;", A);
-test("foo;a=b;bar", A);
-test("foo;a=b;bar;", A);
-test("foo;a=b;bar ", A);
-test("foo;a=b;bar ;", A);
+public void testBasicCookieNew() {
+doTestBasicCookie(true);
+}
+
+private void doTestBasicCookie(boolean useRfc6265) {
+test(useRfc6265, "foo=bar; a=b", FOO, A);
+test(useRfc6265, "foo=bar;a=b", FOO, A);
+test(useRfc6265, "foo=bar;a=b;", FOO, A);
+test(useRfc6265, "foo=bar;a=b; ", FOO, A);
+test(useRfc6265, "foo=bar;a=b; ;", FOO, A);
+}
+
+@Test
+public void testNameOnlyAreDroppedOld() {
+test(false, "foo=;a=b; ;", A);
+test(false, "foo;a=b; ;", A);
+test(false, "foo;a=b;bar", A);
+test(false, "foo;a=b;bar;", A);
+test(false, "foo;a=b;bar ", A);
+test(false, "foo;a=b;bar ;", A);
+
+// Bug 49000
+Cookie fred = new Cookie("fred", "1");
+Cookie jim = new Cookie("jim", "2");
+Cookie george = new Cookie("george", "3");
+test(false, "fred=1; jim=2; bob", fred, jim);
+test(false, "fred=1; jim=2; bob; george=3", fred, jim, george);
+test(false, "fred=1; jim=2; bob=; george=3", fred, jim, george);
+test(false, "fred=1; jim=2; bob=", fred, jim);
+}
+
+@Test
+public void testNameOnlyAreDroppedNew() {
+// Name only cookies are not dropped in RFC6265
+test(true, "foo=;a=b; ;", FOO_EMPTY, A);
+test(true, "foo;a=b; ;", FOO_NULL, A);
+test(true, "foo;a=b;bar", FOO_NULL, A, BAR_NULL);
+test(true, "foo;a=b;bar;", FOO_NULL, A, BAR_NULL);
+test(true, "foo;a=b;bar ", FOO_NULL, A, BAR_NULL);
+test(true, "foo;a=b;bar ;", FOO_NULL, A, BAR_NULL);
 
 // Bug 49000
 Cookie fred = new Cookie("fred", "1");
 Cookie jim = new Cookie("jim", "2");
+Cookie bobNull = new Cookie("bob", null);
+Cookie bobEmpty = new Cookie("bob", "");
 Cookie george = new Cookie("george", "3");
-test("fred=1; jim=2; bob", fred, jim);
-test("fred=1; jim=2; bob; george=3", fred, jim, george);
-test("fred=1; jim=2; bob=; george=3", fred, jim, george);
-test("fred=1; jim=2; bob=", fred, jim);
+test(true, "fred=1; jim=2; bob", fred, jim, bobNull);
+test(true, "fred=1; jim=2; bob; george=3", fred, jim, bobNull, george);
+test(true, "fred=1; jim=2; bob=; george=3", fred, jim, bobEmpty, 
george);
+test(true, "fred=1; jim=2; bob=", fred, jim, bobEmpty);
 }
 
 @Test
-public void testQuotedValue() {
-test("foo=bar;a=\"b\"", FOO, A);
-test("foo=bar;a=\"b\";", FOO, A);
+public void testQuotedValueOld() {
+doTestQuotedValue(false);
 }
 
 @Test
-public void testEmptyPairs() {
-test("foo;a=b; ;bar", A);
-test("foo;a=b;;bar", A);
-test("foo;a=b; ;;bar=rab", A, BAR);
-test("foo;a=b;; ;bar=rab", A, BAR);
-test("foo;a=b;;#;bar=rab", A, BAR);
-test("foo;a=b;;\\;bar=rab", A, BAR);
+public void testQuotedValueNew() {
+doTestQuotedValue(true);
+}
+
+private void doTestQuotedValue(boolean useRfc6265) {
+test(useRfc6265, "foo=bar;a=\"b\"", FOO, A);
+test(useRfc6265, "foo=bar;a=\"b\";", FOO, A);
 }
 
 @Test
-public void testSeparatorsInValue() {
-tes

svn commit: r1621986 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:07 2014
New Revision: 1621986

URL: http://svn.apache.org/r1621986
Log:
Update names

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621986&r1=1621985&r2=1621986&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:07 2014
@@ -41,7 +41,7 @@ public class TestCookies {
 }
 
 @Test
-public void testBasicCookieNew() {
+public void testBasicCookieRfc6265() {
 doTestBasicCookie(true);
 }
 
@@ -73,7 +73,7 @@ public class TestCookies {
 }
 
 @Test
-public void testNameOnlyAreDroppedNew() {
+public void testNameOnlyAreDroppedRfc6265() {
 // Name only cookies are not dropped in RFC6265
 test(true, "foo=;a=b; ;", FOO_EMPTY, A);
 test(true, "foo;a=b; ;", FOO_NULL, A);
@@ -100,7 +100,7 @@ public class TestCookies {
 }
 
 @Test
-public void testQuotedValueNew() {
+public void testQuotedValueRfc6265() {
 doTestQuotedValue(true);
 }
 
@@ -120,7 +120,7 @@ public class TestCookies {
 }
 
 @Test
-public void testEmptyPairsNew() {
+public void testEmptyPairsRfc6265() {
 test(true, "foo;a=b; ;bar", FOO_NULL, A, BAR_NULL);
 test(true, "foo;a=b;;bar", FOO_NULL, A, BAR_NULL);
 test(true, "foo;a=b; ;;bar=rab", FOO_NULL, A, BAR);
@@ -135,7 +135,7 @@ public class TestCookies {
 }
 
 @Test
-public void testSeparatorsInValueNew() {
+public void testSeparatorsInValueRfc6265() {
 doTestSeparatorsInValue(true);
 }
 
@@ -150,7 +150,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1TokenValueNew() {
+public void v1TokenValueRfc6265() {
 doV1TokenValue(true);
 }
 
@@ -167,7 +167,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1NameOnlyIsDroppedNew() {
+public void v1NameOnlyIsDroppedRfc6265() {
 doV1NameOnlyIsDropped(true);
 }
 
@@ -184,7 +184,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1QuotedValueNew() {
+public void v1QuotedValueRfc6265() {
 doV1QuotedValue(true);
 }
 
@@ -201,7 +201,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1DQuoteInValueNew() {
+public void v1DQuoteInValueRfc6265() {
 doV1DQuoteInValue(true);
 }
 
@@ -218,7 +218,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1QuoteInValueNew() {
+public void v1QuoteInValueRfc6265() {
 doV1QuoteInValue(true);
 }
 
@@ -236,7 +236,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1QuoteInQuotedValueNew() {
+public void v1QuoteInQuotedValueRfc6265() {
 doV1QuoteInQuotedValue(true);
 }
 
@@ -253,7 +253,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1EscapedDQuoteInValueNew() {
+public void v1EscapedDQuoteInValueRfc6265() {
 doV1EscapedDQuoteInValue(true);
 }
 
@@ -270,7 +270,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1QuotedValueEndsInBackslashNew() {
+public void v1QuotedValueEndsInBackslashRfc6265() {
 doV1QuotedValueEndsInBackslash(true);
 }
 
@@ -285,7 +285,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1MismatchedQuotesNew() {
+public void v1MismatchedQuotesRfc6265() {
 doV1MismatchedQuotes(true);
 }
 
@@ -300,7 +300,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1SingleQuotesAreValidTokenCharactersNew() {
+public void v1SingleQuotesAreValidTokenCharactersRfc6265() {
 doV1SingleQuotesAreValidTokenCharacters(true);
 }
 
@@ -316,7 +316,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1DomainIsParsedNew() {
+public void v1DomainIsParsedRfc6265() {
 doV1DomainIsParsed(true);
 }
 
@@ -334,7 +334,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1DomainOnlyAffectsPrecedingCookieNew() {
+public void v1DomainOnlyAffectsPrecedingCookieRfc6265() {
 doV1DomainOnlyAffectsPrecedingCookie(true);
 }
 
@@ -351,7 +351,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1PortIsIgnoredNew() {
+public void v1PortIsIgnoredRfc6265() {
 doV1PortIsIgnored(true);
 }
 
@@ -368,7 +368,7 @@ public class TestCookies {
 }
 
 @Test
-public void v1PathAffectsPrecedingCookieNew() {
+public void v1PathAffectsPrecedingCookieRfc6265() {
 doV1PathAffectsPrecedingCookie(true);
 }
 
@@ -385,7 +385,7 @@ public class TestCookies {
 }
 
 @Test
-public void rfc2109Version0New() {
+public void rfc

svn commit: r1621987 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:12 2014
New Revision: 1621987

URL: http://svn.apache.org/r1621987
Log:
Name only cookies now always return a zero length value rather than a
null value.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621987&r1=1621986&r2=1621987&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:12 2014
@@ -27,13 +27,12 @@ import org.junit.Test;
 import org.apache.tomcat.util.buf.MessageBytes;
 
 public class TestCookies {
-private Cookie FOO = new Cookie("foo", "bar");
-private Cookie FOO_NULL = new Cookie("foo", null);
-private Cookie FOO_EMPTY = new Cookie("foo", "");
-private Cookie BAR = new Cookie("bar", "rab");
-private Cookie BAR_NULL = new Cookie("bar", null);
-private Cookie A = new Cookie("a", "b");
-private Cookie HASH_NULL = new Cookie("#", null);
+private final Cookie FOO = new Cookie("foo", "bar");
+private final Cookie FOO_EMPTY = new Cookie("foo", "");
+private final Cookie BAR = new Cookie("bar", "rab");
+private final Cookie BAR_EMPTY = new Cookie("bar", "");
+private final Cookie A = new Cookie("a", "b");
+private final Cookie HASH_EMPTY = new Cookie("#", "");
 
 @Test
 public void testBasicCookieOld() {
@@ -76,20 +75,19 @@ public class TestCookies {
 public void testNameOnlyAreDroppedRfc6265() {
 // Name only cookies are not dropped in RFC6265
 test(true, "foo=;a=b; ;", FOO_EMPTY, A);
-test(true, "foo;a=b; ;", FOO_NULL, A);
-test(true, "foo;a=b;bar", FOO_NULL, A, BAR_NULL);
-test(true, "foo;a=b;bar;", FOO_NULL, A, BAR_NULL);
-test(true, "foo;a=b;bar ", FOO_NULL, A, BAR_NULL);
-test(true, "foo;a=b;bar ;", FOO_NULL, A, BAR_NULL);
+test(true, "foo;a=b; ;", FOO_EMPTY, A);
+test(true, "foo;a=b;bar", FOO_EMPTY, A, BAR_EMPTY);
+test(true, "foo;a=b;bar;", FOO_EMPTY, A, BAR_EMPTY);
+test(true, "foo;a=b;bar ", FOO_EMPTY, A, BAR_EMPTY);
+test(true, "foo;a=b;bar ;", FOO_EMPTY, A, BAR_EMPTY);
 
 // Bug 49000
 Cookie fred = new Cookie("fred", "1");
 Cookie jim = new Cookie("jim", "2");
-Cookie bobNull = new Cookie("bob", null);
 Cookie bobEmpty = new Cookie("bob", "");
 Cookie george = new Cookie("george", "3");
-test(true, "fred=1; jim=2; bob", fred, jim, bobNull);
-test(true, "fred=1; jim=2; bob; george=3", fred, jim, bobNull, george);
+test(true, "fred=1; jim=2; bob", fred, jim, bobEmpty);
+test(true, "fred=1; jim=2; bob; george=3", fred, jim, bobEmpty, 
george);
 test(true, "fred=1; jim=2; bob=; george=3", fred, jim, bobEmpty, 
george);
 test(true, "fred=1; jim=2; bob=", fred, jim, bobEmpty);
 }
@@ -121,12 +119,12 @@ public class TestCookies {
 
 @Test
 public void testEmptyPairsRfc6265() {
-test(true, "foo;a=b; ;bar", FOO_NULL, A, BAR_NULL);
-test(true, "foo;a=b;;bar", FOO_NULL, A, BAR_NULL);
-test(true, "foo;a=b; ;;bar=rab", FOO_NULL, A, BAR);
-test(true, "foo;a=b;; ;bar=rab", FOO_NULL, A, BAR);
-test(true, "foo;a=b;;#;bar=rab", FOO_NULL, A, HASH_NULL, BAR);
-test(true, "foo;a=b;;\\;bar=rab", FOO_NULL, A, BAR);
+test(true, "foo;a=b; ;bar", FOO_EMPTY, A, BAR_EMPTY);
+test(true, "foo;a=b;;bar", FOO_EMPTY, A, BAR_EMPTY);
+test(true, "foo;a=b; ;;bar=rab", FOO_EMPTY, A, BAR);
+test(true, "foo;a=b;; ;bar=rab", FOO_EMPTY, A, BAR);
+test(true, "foo;a=b;;#;bar=rab", FOO_EMPTY, A, HASH_EMPTY, BAR);
+test(true, "foo;a=b;;\\;bar=rab", FOO_EMPTY, A, BAR);
 }
 
 @Test



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



svn commit: r1621988 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:16 2014
New Revision: 1621988

URL: http://svn.apache.org/r1621988
Log:
Adjust test as RFC6265/2109 parser only permits $Version=1

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621988&r1=1621987&r2=1621988&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:16 2014
@@ -379,17 +379,14 @@ public class TestCookies {
 
 @Test
 public void rfc2109Version0Old() {
-doRfc2109Version0(false);
+// rfc2109 semantically does not allow $Version to be 0 but it is 
valid syntax
+test(false, "$Version=0;foo=bar", FOO);
 }
 
 @Test
 public void rfc2109Version0Rfc6265() {
-doRfc2109Version0(true);
-}
-
-private void doRfc2109Version0(boolean useRfc6265) {
-// rfc2109 semantically does not allow $Version to be 0 but it is 
valid syntax
-test(useRfc6265, "$Version=0;foo=bar", FOO);
+// Neither RFC2109 nor RFc6265 allow version 0
+test(true, "$Version=0;foo=bar");
 }
 
 private void test(boolean useRfc6265, String header, Cookie... expected) {



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



svn commit: r1621990 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:25 2014
New Revision: 1621990

URL: http://svn.apache.org/r1621990
Log:
RFC2109 parser that passes the tests - still several TODOs.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621990&r1=1621989&r2=1621990&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:25 2014
@@ -33,6 +33,7 @@ public class TestCookies {
 private final Cookie BAR_EMPTY = new Cookie("bar", "");
 private final Cookie A = new Cookie("a", "b");
 private final Cookie HASH_EMPTY = new Cookie("#", "");
+private final Cookie $PORT = new Cookie("$Port", "8080");
 
 @Test
 public void testBasicCookieOld() {
@@ -342,19 +343,19 @@ public class TestCookies {
 
 @Test
 public void v1PortIsIgnoredOld() {
-doV1PortIsIgnored(false);
+FOO.setVersion(1);
+FOO.setDomain("apache.org");
+A.setVersion(1);
+test(false, 
"$Version=1;foo=\"bar\";$Domain=apache.org;$Port=8080;a=b", FOO, A);
 }
 
 @Test
 public void v1PortIsIgnoredRfc6265() {
-doV1PortIsIgnored(true);
-}
-
-private void doV1PortIsIgnored(boolean useRfc6265) {
 FOO.setVersion(1);
 FOO.setDomain("apache.org");
+$PORT.setVersion(1);
 A.setVersion(1);
-test(useRfc6265, 
"$Version=1;foo=\"bar\";$Domain=apache.org;$Port=8080;a=b", FOO, A);
+test(true, "$Version=1;foo=\"bar\";$Domain=apache.org;$Port=8080;a=b", 
FOO, $PORT, A);
 }
 
 @Test



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



svn commit: r1621989 - /tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:41:20 2014
New Revision: 1621989

URL: http://svn.apache.org/r1621989
Log:
Add parsing for RFC2109 values

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1621989&r1=1621988&r2=1621989&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
13:41:20 2014
@@ -195,19 +195,16 @@ public class TestCookies {
 
 @Test
 public void v1DQuoteInValueOld() {
-doV1DQuoteInValue(false);
+FOO.setValue("b");
+FOO.setVersion(1);
+A.setVersion(1);
+test(false, "$Version=1;foo=\"b\"ar\";a=b", FOO, A); // Incorrectly 
escaped.
 }
 
 @Test
 public void v1DQuoteInValueRfc6265() {
-doV1DQuoteInValue(true);
-}
-
-private void doV1DQuoteInValue(boolean useRfc6265) {
-FOO.setValue("b");
-FOO.setVersion(1);
 A.setVersion(1);
-test(useRfc6265, "$Version=1;foo=\"b\"ar\";a=b", FOO, A); // 
Incorrectly escaped.
+test(true, "$Version=1;foo=\"b\"ar\";a=b", A); // Incorrectly escaped.
 }
 
 @Test
@@ -403,7 +400,9 @@ public class TestCookies {
 ServerCookie actual = cookies.getCookie(i);
 Assert.assertEquals(cookie.getVersion(), actual.getVersion());
 Assert.assertEquals(cookie.getName(), actual.getName().toString());
-Assert.assertEquals(cookie.getValue(), 
actual.getValue().toString());
+Assert.assertEquals(cookie.getValue(),
+
org.apache.tomcat.util.http.parser.Cookie.unescapeCookieValueRfc2109(
+actual.getValue().toString()));
 if (cookie.getVersion() == 1) {
 Assert.assertEquals(cookie.getDomain(), 
actual.getDomain().toString());
 Assert.assertEquals(cookie.getPath(), 
actual.getPath().toString());



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



svn commit: r1621983 - in /tomcat/trunk: java/org/apache/catalina/ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/http

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 13:40:53 2014
New Revision: 1621983

URL: http://svn.apache.org/r1621983
Log:
Add a per context option to select the cookie parser to use and add the
necessary plumbing to pass that choice to the cookie parser.

Modified:
tomcat/trunk/java/org/apache/catalina/Context.java
tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/trunk/java/org/apache/catalina/connector/Request.java
tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java
tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java
tomcat/trunk/test/org/apache/catalina/core/TesterContext.java
tomcat/trunk/webapps/docs/config/context.xml

Modified: tomcat/trunk/java/org/apache/catalina/Context.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Context.java?rev=1621983&r1=1621982&r2=1621983&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/Context.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Context.java Tue Sep  2 13:40:53 2014
@@ -17,6 +17,7 @@
 package org.apache.catalina;
 
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
@@ -1637,4 +1638,40 @@ public interface Context extends Contain
  * context.
  */
 public Object getNamingToken();
+
+/**
+ * Should this context use the new RFC6265 based cookie parser for
+ * processing HTTP cookies? The default value is currently false but that
+ * may change in a future point release.
+ */
+public void setUseRfc6265(boolean useRfc6265);
+
+/**
+ * Does this context use the new RFC6265 based cookie parser for
+ * processing HTTP cookies? The default value is currently false but that
+ * may change in a future point release.
+ */
+public boolean getUseRfc6265();
+
+/**
+ * Specifies the name of the character encoding to use to convert bytes 
into
+ * characters when processing cookies using the RFC6265 based cookie 
parser.
+ * It has no effect if the RFC6265 parser is not used.
+ * If an unrecognised character encoding is specified, a warning will be
+ * logged and the default value of UTF-8 will be used.
+ */
+public void setCookieEncoding(String encoding);
+
+/**
+ * Returns the name of the character encoding used to convert bytes into
+ * characters when processing cookies using the RFC6265 based cookie 
parser.
+ * The default value is UTF-8.
+ */
+public String getCookieEncoding();
+
+/**
+ * Returns the character set used to convert bytes into characters when
+ * processing cookies using the RFC6265 based cookie parser.
+ */
+public Charset getCookieEncodingCharset();
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1621983&r1=1621982&r2=1621983&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Tue Sep  
2 13:40:53 2014
@@ -900,6 +900,13 @@ public class CoyoteAdapter implements Ad
 }
 }
 
+if (request.getContext().getUseRfc6265()) {
+req.getCookies().setUseRfc6265(true);
+} else {
+req.getCookies().setUseRfc6265(false);
+}
+
+
 // Look for session ID in cookies and SSL session
 parseSessionCookiesId(req, request);
 parseSessionSslId(request);
@@ -931,6 +938,9 @@ public class CoyoteAdapter implements Ad
 // Reset mapping
 request.getMappingData().recycle();
 mapRequired = true;
+// Recycle cookies in case correct context is
+// configured with different settings
+req.getCookies().recycle();
 }
 break;
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1621983&r1=1621982&r2=1621983&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue Sep  2 
13:40:53 2014
@@ -2865

Re: [VOTE] Release Apache Tomcat 8.0.12

2014-09-02 Thread Mark Thomas
On 30/08/2014 16:34, Mark Thomas wrote:
> The proposed Apache Tomcat 8.0.12 release is now available for voting.
> 
> The main changes since 8.0.11 are:
> - Fix a regression in the processing of includes and forwards when
>   Contexts had been reloaded.
> - Session ID generation is now extensible
> - Extend support for the permessage-deflate extension to compression of
>   outgoing messages on the server side
> 
> There is also the usual collection of bug fixes, new features and
> performance improvements. For full details, see the changelog:
> http://svn.us.apache.org/repos/asf/tomcat/trunk/webapps/docs/changelog.xml
> 
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.0.12/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1021/
> The svn tag is:
> http://svn.apache.org/repos/asf/tomcat/tc8.0.x/tags/TOMCAT_8_0_12/
> 
> The proposed 8.0.12 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.0.12

Unit tests pass with 64-bit Java on OSX, Windows and Linux for BIO, NIO,
NIO2 and APR/native HTTP connectors.

Mark

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



svn commit: r1621998 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/jasper/servlet/ test/org/apache/jasper/runtime/ test/webapp-3.0/jsp/ webapps/docs/

2014-09-02 Thread violetagg
Author: violetagg
Date: Tue Sep  2 13:46:45 2014
New Revision: 1621998

URL: http://svn.apache.org/r1621998
Log:
Merged revision 1621975 from tomcat/trunk:
According to JavaDoc javax.servlet.jsp.PageContext.include(String) and 
javax.servlet.jsp.PageContext.include(String, boolean) must throw IOException 
if I/O error occur during the operation.
When JSPServlet init parameter "development" is "false" then IOException is 
re-thrown, but when the parameter is "true", JasperException is thrown instead 
of IOException.
This change guarantees that IOException is always re-thrown.

Added:
tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/   (with props)
tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp
tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
tomcat/tc7.0.x/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1621975

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1621998&r1=1621997&r2=1621998&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java 
Tue Sep  2 13:46:45 2014
@@ -456,8 +456,8 @@ public class JspServletWrapper {
 }
 throw ex;
 } catch (IOException ex) {
-if(options.getDevelopment()) {
-throw handleJspException(ex);
+if (options.getDevelopment()) {
+throw new IOException(handleJspException(ex).getMessage(), ex);
 }
 throw ex;
 } catch (IllegalStateException ex) {

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java?rev=1621998&r1=1621997&r2=1621998&view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/jasper/runtime/TestPageContextImpl.java 
Tue Sep  2 13:46:45 2014
@@ -80,6 +80,38 @@ public class TestPageContextImpl extends
 Assert.assertTrue(result.contains("OK"));
 }
 
+@Test
+public void testIncludeThrowsIOException() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir = new File("test/webapp-3.0");
+tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+tomcat.start();
+
+ByteChunk res = new ByteChunk();
+
+int rc = getUrl("http://localhost:"; + getPort() + 
"/test/jsp/pageContext1.jsp", res, null);
+
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+
+String body = res.toString();
+Assert.assertTrue(body.contains("OK"));
+Assert.assertFalse(body.contains("FAILED"));
+
+res = new ByteChunk();
+
+rc = getUrl("http://localhost:"; + getPort() + 
"/test/jsp/pageContext1.jsp?flush=true", res,
+null);
+
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+
+body = res.toString();
+Assert.assertTrue(body.contains("Flush"));
+Assert.assertTrue(body.contains("OK"));
+Assert.assertFalse(body.contains("FAILED"));
+}
+
 public static class Bug56010 extends HttpServlet {
 
 private static final long serialVersionUID = 1L;

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/
--
bugtraq:append = false

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/
--
bugtraq:label = Bugzilla ID (optional)

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/
--
--- bugtraq:logregex (added)
+++ bugtraq:logregex Tue Sep  2 13:46:45 2014
@@ -0,0 +1,2 @@
+(https?\://issues.apache.org/bugzilla/show_bug.cgi\?id=\d+|BZ\s?\d+)
+(\d+)

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/
--
--- bugtraq:message (added)
+++ bugtraq:message Tue Sep  2 13:46:45 2014
@@ -0,0 +1 @@
+Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/
-

Re: RFC6265 progress

2014-09-02 Thread Mark Thomas
On 01/09/2014 13:49, Mark Thomas wrote:
> As previously advertised, I've been working on a new RFC6265 cookie
> parsing. The current status is as follows:
> - parser is working for RFC6265 cookie headers
> - RFC2109 parsing is still TODO
> - new parser is driven by Context level config (no more system
>   properties)
> - currently between 1% and 3% slower
> - code is easier to follow (more smaller methods)
> 
> There is some refactoring involved that I'll commit shortly. I'll also
> commit as much of the parser as I can without changing the current
> behaviour (even optionally). I'll commit the remaining code once I have
> written the RFC2109 part of the parser.

This is done - at least for an initial implementation. There are a
handful of TODOs in the code and I want to look at what i can do to
reduce the copy and paste in the RFC2109 parsing code.

> It might be possible to squeeze a little more performance from the
> parser but I think we are close to the point where further changes are
> going to really impact readability of the code.

I was able to squeeze out a little more performance without impacting
readability. The original and the new RFC6265 parser now have as near as
makes no difference the same performance.

Next steps are:
- addressing the TODOs
- adding lots more tests

Writing some unit tests to test edge cases (and almost certainly
demonstrate some bugs) in the Cookie parsing is one place where someone
new to Tomcat development and wanting to contribute could get started.

Mark

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



Re: svn commit: r1621975 - in /tomcat/trunk: java/org/apache/jasper/servlet/JspServletWrapper.java test/org/apache/jasper/runtime/TestPageContextImpl.java test/webapp/jsp/pageContext1.jsp test/webapp/

2014-09-02 Thread Violeta Georgieva
Hi,


2014-09-02 16:37 GMT+03:00 Rémy Maucherat :
>
> 2014-09-02 15:11 GMT+02:00 :
>
> > Author: violetagg
> > Date: Tue Sep  2 13:11:20 2014
> > New Revision: 1621975
> >
> > URL: http://svn.apache.org/r1621975
> > Log:
> > According to JavaDoc javax.servlet.jsp.PageContext.include(String) and
> > javax.servlet.jsp.PageContext.include(String, boolean) must throw
> > IOException if I/O error occur during the operation.
> > When JSPServlet init parameter "development" is "false" then IOException
> > is re-thrown, but when the parameter is "true", JasperException is
thrown
> > instead of IOException.
> > This change guarantees that IOException is always re-thrown.
> >
>
> The purpose of the JSPException is to give debug information to be able to
> print out the details of the error. I am sorry Jasper will not pass the
TCK
> in dev mode, but likely this must remain as is. Unless you took care of
> that somehow, this will likely have to be -1ed.

I kept the debug information:

+if (options.getDevelopment()) {
+throw new IOException(handleJspException(ex).getMessage(),
ex);

and it is not about passing TCK but it is about the inconsistency in the
behavior:

in the production mode everything is OK but in debug mode the exception is
not re-thrown.

Wdyt?

Violeta


> Rémy


Re: svn commit: r1621975 - in /tomcat/trunk: java/org/apache/jasper/servlet/JspServletWrapper.java test/org/apache/jasper/runtime/TestPageContextImpl.java test/webapp/jsp/pageContext1.jsp test/webapp/

2014-09-02 Thread Rémy Maucherat
2014-09-02 15:51 GMT+02:00 Violeta Georgieva :

> Hi,
>
>
> 2014-09-02 16:37 GMT+03:00 Rémy Maucherat :
> >
> > 2014-09-02 15:11 GMT+02:00 :
> >
> > > Author: violetagg
> > > Date: Tue Sep  2 13:11:20 2014
> > > New Revision: 1621975
> > >
> > > URL: http://svn.apache.org/r1621975
> > > Log:
> > > According to JavaDoc javax.servlet.jsp.PageContext.include(String) and
> > > javax.servlet.jsp.PageContext.include(String, boolean) must throw
> > > IOException if I/O error occur during the operation.
> > > When JSPServlet init parameter "development" is "false" then
> IOException
> > > is re-thrown, but when the parameter is "true", JasperException is
> thrown
> > > instead of IOException.
> > > This change guarantees that IOException is always re-thrown.
> > >
> >
> > The purpose of the JSPException is to give debug information to be able
> to
> > print out the details of the error. I am sorry Jasper will not pass the
> TCK
> > in dev mode, but likely this must remain as is. Unless you took care of
> > that somehow, this will likely have to be -1ed.
>
> I kept the debug information:
>
> +if (options.getDevelopment()) {
> +throw new IOException(handleJspException(ex).getMessage(),
> ex);
>
> and it is not about passing TCK but it is about the inconsistency in the
> behavior:
>
> in the production mode everything is OK but in debug mode the exception is
> not re-thrown.
>
> Wdyt?
>
> I checked the exception report looked ok in the test with the usual
details from the included page, so I'll assume it will be fine in the error
page generated for the browser.

Rémy


Re: RFC6265 progress

2014-09-02 Thread Rémy Maucherat
2014-09-02 15:47 GMT+02:00 Mark Thomas :

> I was able to squeeze out a little more performance without impacting
> readability. The original and the new RFC6265 parser now have as near as
> makes no difference the same performance.
>
> Nice.

Rémy


svn commit: r1622004 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 14:10:51 2014
New Revision: 1622004

URL: http://svn.apache.org/r1622004
Log:
Add a warning to the docs for future developers.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1622004&r1=1622003&r2=1622004&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
14:10:51 2014
@@ -37,6 +37,12 @@ import org.apache.tomcat.util.res.String
  *   For cookies without a value, the '=' is not required after the name as
  *   some browsers do not sent it.
  * 
+ *
+ * Implementation note:
+ * This class has been carefully tuned to ensure that it has equal or better
+ * performance than the original Netscape/RFC2109 cookie parser. Before
+ * committing and changes, ensure that the TesterCookiePerformance unit test
+ * continues to give results within 1% for the old and new parsers.
  */
 public class Cookie {
 



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



svn commit: r1622008 - /tomcat/trunk/webapps/docs/changelog.xml

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 14:12:59 2014
New Revision: 1622008

URL: http://svn.apache.org/r1622008
Log:
Changelog for the RFC6265 cookie parser

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1622008&r1=1622007&r2=1622008&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep  2 14:12:59 2014
@@ -63,6 +63,11 @@
 names are separated by commas. Identified by Coverity Scan and fixed
 based on a patch by Felix Schumacher. (markt)
   
+  
+Add an additional implementation of a RFC6265 based cookie parser along
+with new Context options to select and configure it. This parser is
+currently considered experiemental and is not used by default. (markt)
+  
 
   
   



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



svn commit: r1622031 - in /tomcat/trunk: test/org/apache/tomcat/util/http/TestCookies.java webapps/docs/changelog.xml

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:10:41 2014
New Revision: 1622031

URL: http://svn.apache.org/r1622031
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55917
The new cookie parser correctly handles 8-bit values.
Add the test cases from the proposed patch by Jeremy Boynes.
NOte RFC2616 does not treat any characters in the range 0x80 to 0xFF as control 
characters.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1622031&r1=1622030&r2=1622031&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
15:10:41 2014
@@ -29,6 +29,7 @@ import org.apache.tomcat.util.buf.Messag
 public class TestCookies {
 private final Cookie FOO = new Cookie("foo", "bar");
 private final Cookie FOO_EMPTY = new Cookie("foo", "");
+private final Cookie FOO_CONTROL = new Cookie("foo", "b\u00e1r");
 private final Cookie BAR = new Cookie("bar", "rab");
 private final Cookie BAR_EMPTY = new Cookie("bar", "");
 private final Cookie A = new Cookie("a", "b");
@@ -387,6 +388,67 @@ public class TestCookies {
 test(true, "$Version=0;foo=bar");
 }
 
+@Test
+public void disallow8bitInName() {
+// Bug 55917
+test(true, "f\u00f6o=bar");
+}
+
+@Test
+public void disallowControlInName() {
+// Bug 55917
+test(true, "f\010o=bar");
+}
+
+@Test
+public void disallow8BitControlInName() {
+// Bug 55917
+test(true, "f\210o=bar");
+}
+
+@Test
+public void allow8BitInV0Value() {
+// Bug 55917
+test(true, "foo=b\u00e1r", FOO_CONTROL);
+}
+
+@Test
+public void disallow8bitInV1UnquotedValue() {
+// Bug 55917
+test(true, "$Version=1; foo=b\u00e1r");
+}
+
+@Test
+public void allow8bitInV1QuotedValue() {
+// Bug 55917
+FOO_CONTROL.setVersion(1);
+test(true, "$Version=1; foo=\"b\u00e1r\"", FOO_CONTROL);
+}
+
+@Test
+public void disallowControlInV0Value() {
+// Bug 55917
+test(true, "foo=b\010r");
+}
+
+@Test
+public void disallowControlInV1UnquotedValue() {
+// Bug 55917
+test(true, "$Version=1; foo=b\010r");
+}
+
+@Test
+public void disallowControlInV1QuotedValue() {
+// Bug 55917
+test(true, "$Version=1; foo=\"b\010r\"");
+}
+
+@Test
+public void disallow8BitControlInV1UnquotedValue() {
+// Bug 55917
+test(true, "$Version=1; foo=b\210r");
+}
+
 private void test(boolean useRfc6265, String header, Cookie... expected) {
 MimeHeaders mimeHeaders = new MimeHeaders();
 Cookies cookies = new Cookies(mimeHeaders);
@@ -401,6 +463,7 @@ public class TestCookies {
 ServerCookie actual = cookies.getCookie(i);
 Assert.assertEquals(cookie.getVersion(), actual.getVersion());
 Assert.assertEquals(cookie.getName(), actual.getName().toString());
+
actual.getValue().getByteChunk().setCharset(StandardCharsets.UTF_8);
 Assert.assertEquals(cookie.getValue(),
 
org.apache.tomcat.util.http.parser.Cookie.unescapeCookieValueRfc2109(
 actual.getValue().toString()));

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1622031&r1=1622030&r2=1622031&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep  2 15:10:41 2014
@@ -48,6 +48,12 @@
   
 
   
+55917: Allow bytes in the range 0x80 to 0xFF to appear in
+cookie values if the cookie is a V1 (RFC2109) cookie and the value is
+correctly quoted. The new RFC6265 based cookie parser must be enabled 
to
+correctly handle these cookies. (markt)
+  
+  
 56900: Fix some potential resource leaks when reading
 property files reported by Coverity Scan. Based on patches provided by
 Felix Schumacher. (markt)



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



[Bug 55917] Cookie parsing fails hard with ISO-8859-1 values

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55917

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Mark Thomas  ---
The new RFC6265 cookie parser (that also includes a new RFC2109 parser)
correctly handles these values. I don't propose fixing the old parser.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



[Bug 55951] HTML5 specifies UTF-8 encoding for cookie values

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55951
Bug 55951 depends on bug 55917, which changed state.

Bug 55917 Summary: Cookie parsing fails hard with ISO-8859-1 values
https://issues.apache.org/bugzilla/show_bug.cgi?id=55917

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



svn commit: r1622033 - in /tomcat/trunk: test/org/apache/tomcat/util/http/TestCookies.java webapps/docs/changelog.xml

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:23:24 2014
New Revision: 1622033

URL: http://svn.apache.org/r1622033
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55918
The new cookie parser correctly handles control characters in quoted V1 values

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1622033&r1=1622032&r2=1622033&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
15:23:24 2014
@@ -439,7 +439,7 @@ public class TestCookies {
 
 @Test
 public void disallowControlInV1QuotedValue() {
-// Bug 55917
+// Bug 55917 / Bug 55918
 test(true, "$Version=1; foo=\"b\010r\"");
 }
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1622033&r1=1622032&r2=1622033&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep  2 15:23:24 2014
@@ -54,6 +54,11 @@
 correctly handle these cookies. (markt)
   
   
+55918: Do not permit control characters to appear in quoted
+V1 (RFC2109) cookie values. The new RFC6265 based cookie parser must be
+enabled to correctly handle these cookies. (markt)
+  
+  
 56900: Fix some potential resource leaks when reading
 property files reported by Coverity Scan. Based on patches provided by
 Felix Schumacher. (markt)



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



[Bug 55918] CTL characters may appear in quoted values for RFC2109 V1 cookies

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55918

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Mark Thomas  ---
The new RFC6265 cookie parser (that also includes a new RFC2109 parser)
correctly handles these values. I don't propose fixing the old parser.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



svn commit: r1622034 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:25:34 2014
New Revision: 1622034

URL: http://svn.apache.org/r1622034
Log:
More docs

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1622034&r1=1622033&r2=1622034&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
15:25:34 2014
@@ -27,16 +27,21 @@ import org.apache.tomcat.util.res.String
 
 
 /**
- * Cookie header parser based on RFC6265 and RFC2109.
- * 
- * The parsing of cookies using RFC6265 is more relaxed that the specification
- * in the following ways:
+ * Cookie header parser based on RFC6265 and RFC2109.
+ * The parsing of cookies using RFC6265 is more relaxed that the
+ * specification in the following ways:
  * 
  *   Values 0x80 to 0xFF are permitted in cookie-octet to support the use 
of
  *   UTF-8 in cookie values as used by HTML 5.
  *   For cookies without a value, the '=' is not required after the name as
  *   some browsers do not sent it.
  * 
+ * The parsing of cookies using RFC2109 is more relaxed that the
+ * specification in the following ways:
+ * 
+ *   Values for the path attribute that contain a / character do not have 
to
+ *   be quoted even though / is not permitted in a token.
+ * 
  *
  * Implementation note:
  * This class has been carefully tuned to ensure that it has equal or better



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



svn commit: r1622036 - in /tomcat/trunk: test/org/apache/tomcat/util/http/TestCookies.java webapps/docs/changelog.xml

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:38:58 2014
New Revision: 1622036

URL: http://svn.apache.org/r1622036
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55921
The new cookie parser correctly handles unescaped JSON in cookie values

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1622036&r1=1622035&r2=1622036&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
15:38:58 2014
@@ -449,6 +449,19 @@ public class TestCookies {
 test(true, "$Version=1; foo=b\210r");
 }
 
+@Test
+public void testJsonInV0() {
+// Bug 55921
+test(true, "{\"a\":true, \"b\":false};a=b", A);
+}
+
+@Test
+public void testJsonInV1() {
+// Bug 55921
+A.setVersion(1);
+test(true, "$Version=1;{\"a\":true, \"b\":false};a=b", A);
+}
+
 private void test(boolean useRfc6265, String header, Cookie... expected) {
 MimeHeaders mimeHeaders = new MimeHeaders();
 Cookies cookies = new Cookies(mimeHeaders);

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1622036&r1=1622035&r2=1622036&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep  2 15:38:58 2014
@@ -59,6 +59,11 @@
 enabled to correctly handle these cookies. (markt)
   
   
+55921: Correctly handle (ignore the cookie) unescaped JSON 
in
+a cookie value. The new RFC6265 based cookie parser must be enabled to
+correctly handle these cookies. (markt)
+  
+  
 56900: Fix some potential resource leaks when reading
 property files reported by Coverity Scan. Based on patches provided by
 Felix Schumacher. (markt)



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



[Bug 55921] Cookie values in JSON format are not skipped correctly when parsing fails

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55921

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Mark Thomas  ---
The new RFC6265 cookie parser (that also includes a new RFC2109 parser)
correctly handles these values. I don't propose fixing the old parser.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



svn commit: r1622037 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:47:56 2014
New Revision: 1622037

URL: http://svn.apache.org/r1622037
Log:
Refactor to reduce code duplication

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1622037&r1=1622036&r2=1622037&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
15:47:56 2014
@@ -263,9 +263,7 @@ public class Cookie {
 skipLWS(bb);
 value = readCookieValueRfc2109(bb, false);
 if (value == null) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 skipLWS(bb);
@@ -280,10 +278,7 @@ public class Cookie {
 parseAttributes = false;
 moreToProcess = false;
 } else if (skipResult == SkipResult.NOT_FOUND) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 
@@ -293,18 +288,12 @@ public class Cookie {
 skipLWS(bb);
 skipResult = skipByte(bb, EQUALS_BYTE);
 if (skipResult != SkipResult.FOUND) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 path = readCookieValueRfc2109(bb, true);
 if (path == null) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 skipLWS(bb);
@@ -318,10 +307,7 @@ public class Cookie {
 parseAttributes = false;
 moreToProcess = false;
 } else if (skipResult == SkipResult.NOT_FOUND) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 }
@@ -333,18 +319,12 @@ public class Cookie {
 skipLWS(bb);
 skipResult = skipByte(bb, EQUALS_BYTE);
 if (skipResult != SkipResult.FOUND) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 domain = readCookieValueRfc2109(bb, false);
 if (domain == null) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 
@@ -357,10 +337,7 @@ public class Cookie {
 parseAttributes = false;
 moreToProcess = false;
 } else if (skipResult == SkipResult.NOT_FOUND) {
-logInvalidHeader(bb);
-// Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipInvalidCookie(bb);
 continue;
 }
 }
@@ -382,6 +359,13 @@ public class Cookie {
 }
 
 
+private static void skipInvalidCookie(ByteBuffer bb) {
+logInvalidHeader(bb);
+// Invalid cookie value. Skip to the next semi-colon
+// TODO Could be a comma
+skipUntilSemiColon(bb);
+}
+
 private st

svn commit: r1622040 - in /tomcat/trunk: java/org/apache/tomcat/util/http/parser/Cookie.java test/org/apache/tomcat/util/http/TestCookies.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 15:55:59 2014
New Revision: 1622040

URL: http://svn.apache.org/r1622040
Log:
Fix the remaining TODO in the new cookie parser

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1622040&r1=1622039&r2=1622040&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
15:55:59 2014
@@ -362,8 +362,7 @@ public class Cookie {
 private static void skipInvalidCookie(ByteBuffer bb) {
 logInvalidHeader(bb);
 // Invalid cookie value. Skip to the next semi-colon
-// TODO Could be a comma
-skipUntilSemiColon(bb);
+skipUntilSemiColonOrComma(bb);
 }
 
 private static void skipLWS(ByteBuffer bb) {
@@ -386,6 +385,16 @@ public class Cookie {
 }
 
 
+private static void skipUntilSemiColonOrComma(ByteBuffer bb) {
+while(bb.hasRemaining()) {
+byte b = bb.get();
+if (b == SEMICOLON_BYTE || b == COMMA_BYTE) {
+break;
+}
+}
+}
+
+
 private static SkipResult skipByte(ByteBuffer bb, byte target) {
 
 if (!bb.hasRemaining()) {

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java?rev=1622040&r1=1622039&r2=1622040&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookies.java Tue Sep  2 
15:55:59 2014
@@ -462,6 +462,14 @@ public class TestCookies {
 test(true, "$Version=1;{\"a\":true, \"b\":false};a=b", A);
 }
 
+@Test
+public void testSkipSemicolonOrComma() {
+// V1 cookies can also use commas to separate cookies
+FOO.setVersion(1);
+A.setVersion(1);
+test(true, "$Version=1;x\tx=yyy,foo=bar;a=b", FOO, A);
+}
+
 private void test(boolean useRfc6265, String header, Cookie... expected) {
 MimeHeaders mimeHeaders = new MimeHeaders();
 Cookies cookies = new Cookies(mimeHeaders);



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



svn commit: r1622061 - in /tomcat/trunk/test/webapp/jsp: pageContext1.jsp pageContext2.jsp

2014-09-02 Thread kkolinko
Author: kkolinko
Date: Tue Sep  2 16:31:26 2014
New Revision: 1622061

URL: http://svn.apache.org/r1622061
Log:
svn:eol-style = native

Modified:
tomcat/trunk/test/webapp/jsp/pageContext1.jsp   (contents, props changed)
tomcat/trunk/test/webapp/jsp/pageContext2.jsp   (contents, props changed)

Modified: tomcat/trunk/test/webapp/jsp/pageContext1.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/jsp/pageContext1.jsp?rev=1622061&r1=1622060&r2=1622061&view=diff
==
--- tomcat/trunk/test/webapp/jsp/pageContext1.jsp (original)
+++ tomcat/trunk/test/webapp/jsp/pageContext1.jsp Tue Sep  2 16:31:26 2014
@@ -1,39 +1,39 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-<%@ page import="java.io.IOException" contentType="text/plain"%>
-<%
-boolean flush = Boolean.valueOf(request.getParameter("flush"));
-if (pageContext != null) {
-try {
-if (flush) {
-out.println("Flush");
-pageContext.include("/jsp/pageContext2.jsp", true);
-} else {
-pageContext.include("/jsp/pageContext2.jsp");
-}
-} catch (IOException e) {
-out.println("OK");
-return;
-} catch (Throwable t) {
-out.println("FAILED. Expected IOException, received: " + 
t.getClass().getName());
-return;
-}
-out.println("FAILED. Expected IOException.");
-} else {
-out.println("FAILED. Expected IOException.");
-}
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%@ page import="java.io.IOException" contentType="text/plain"%>
+<%
+boolean flush = Boolean.valueOf(request.getParameter("flush"));
+if (pageContext != null) {
+try {
+if (flush) {
+out.println("Flush");
+pageContext.include("/jsp/pageContext2.jsp", true);
+} else {
+pageContext.include("/jsp/pageContext2.jsp");
+}
+} catch (IOException e) {
+out.println("OK");
+return;
+} catch (Throwable t) {
+out.println("FAILED. Expected IOException, received: " + 
t.getClass().getName());
+return;
+}
+out.println("FAILED. Expected IOException.");
+} else {
+out.println("FAILED. Expected IOException.");
+}
 %>
\ No newline at end of file

Propchange: tomcat/trunk/test/webapp/jsp/pageContext1.jsp
--
svn:eol-style = native

Modified: tomcat/trunk/test/webapp/jsp/pageContext2.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/jsp/pageContext2.jsp?rev=1622061&r1=1622060&r2=1622061&view=diff
==
--- tomcat/trunk/test/webapp/jsp/pageContext2.jsp (original)
+++ tomcat/trunk/test/webapp/jsp/pageContext2.jsp Tue Sep  2 16:31:26 2014
@@ -1,18 +1,18 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licen

svn commit: r1622062 - in /tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp: pageContext1.jsp pageContext2.jsp

2014-09-02 Thread kkolinko
Author: kkolinko
Date: Tue Sep  2 16:32:17 2014
New Revision: 1622062

URL: http://svn.apache.org/r1622062
Log:
svn:eol-style = native

Modified:
tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp   (contents, 
props changed)
tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp   (contents, 
props changed)

Modified: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp?rev=1622062&r1=1622061&r2=1622062&view=diff
==
--- tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp (original)
+++ tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp Tue Sep  2 
16:32:17 2014
@@ -1,39 +1,39 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-<%@ page import="java.io.IOException" contentType="text/plain"%>
-<%
-boolean flush = Boolean.valueOf(request.getParameter("flush"));
-if (pageContext != null) {
-try {
-if (flush) {
-out.println("Flush");
-pageContext.include("/jsp/pageContext2.jsp", true);
-} else {
-pageContext.include("/jsp/pageContext2.jsp");
-}
-} catch (IOException e) {
-out.println("OK");
-return;
-} catch (Throwable t) {
-out.println("FAILED. Expected IOException, received: " + 
t.getClass().getName());
-return;
-}
-out.println("FAILED. Expected IOException.");
-} else {
-out.println("FAILED. Expected IOException.");
-}
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%@ page import="java.io.IOException" contentType="text/plain"%>
+<%
+boolean flush = Boolean.valueOf(request.getParameter("flush"));
+if (pageContext != null) {
+try {
+if (flush) {
+out.println("Flush");
+pageContext.include("/jsp/pageContext2.jsp", true);
+} else {
+pageContext.include("/jsp/pageContext2.jsp");
+}
+} catch (IOException e) {
+out.println("OK");
+return;
+} catch (Throwable t) {
+out.println("FAILED. Expected IOException, received: " + 
t.getClass().getName());
+return;
+}
+out.println("FAILED. Expected IOException.");
+} else {
+out.println("FAILED. Expected IOException.");
+}
 %>
\ No newline at end of file

Propchange: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext1.jsp
--
svn:eol-style = native

Modified: tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp?rev=1622062&r1=1622061&r2=1622062&view=diff
==
--- tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp (original)
+++ tomcat/tc7.0.x/trunk/test/webapp-3.0/jsp/pageContext2.jsp Tue Sep  2 
16:32:17 2014
@@ -1,18 +1,18 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may n

git (yet again)

2014-09-02 Thread Mark Thomas
I've been looking at this again (anything to get a break from writing
parsers for cookies) and chatting with some of the infra folks that look
after the ASF's git repos.

There are a couple of things we need to do:
a) decide how we want to organise development in git
b) decide if we want to move to git

Now the decision we make for a) might influence some folks to make a
different decision for b). On the other hand, there is no point debating
a) if we are never going to move.

So, how do folks want to approach this?
A: Vote to move to git and then figure out how best to use it? or
B: Agree our git workflows and then have a vote on moving to git with
those workflows?

I'm leaning towards A myself.

Mark

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



svn commit: r1622066 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

2014-09-02 Thread markt
Author: markt
Date: Tue Sep  2 16:44:28 2014
New Revision: 1622066

URL: http://svn.apache.org/r1622066
Log:
Trivial whitespace

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java?rev=1622066&r1=1622065&r2=1622066&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/Cookie.java Tue Sep  2 
16:44:28 2014
@@ -76,7 +76,7 @@ public class Cookie {
 
 static {
 // %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E (RFC6265)
-// %x80 to %xFF(UTF-8)
+// %x80 to %xFF (UTF-8)
 for (int i = 0; i < 256; i++) {
 if (i < 0x21 || i == QUOTE_BYTE || i == COMMA_BYTE ||
 i == SEMICOLON_BYTE || i == SLASH_BYTE || i == DEL_BYTE) {
@@ -365,6 +365,7 @@ public class Cookie {
 skipUntilSemiColonOrComma(bb);
 }
 
+
 private static void skipLWS(ByteBuffer bb) {
 while(bb.hasRemaining()) {
 byte b = bb.get();



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



Re: [VOTE] Release Apache Tomcat 8.0.12

2014-09-02 Thread Jeanfrancois Arcand


On 2014-08-30, 11:34 AM, Mark Thomas wrote:

The proposed 8.0.12 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 8.0.12


-- Jeanfrancois



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




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



Re: git (yet again)

2014-09-02 Thread Rémy Maucherat
2014-09-02 18:41 GMT+02:00 Mark Thomas :

> I'm leaning towards A myself.
>

Oh wow, does this mean I can resurrect my thread on Maven too ? (ideally,
we should also move to it first, then think about how to use it later,
otherwise people will never vote in favor)

:)

Rémy


Re: git (yet again)

2014-09-02 Thread Sylvain Laurent
Regarding question b), I vote yes, whatever the organization of the development

Regarding a), for my part I rather see something between A and B. I think of 
the following questions that should be answered first :
- will there be 1 repo per major version like the current SVN setup ? or only 
branches in a unique repo ? 
- how to backport modifications from one major version to another ? is 
cherry-picking ok ?
- where will the main repo be (the one committers will push to)? ASF or github 
? where should we open and treat pull requests, ASF or github ? (currently 
having the SVN repo at ASF and pull requests at github is not convenient)

Sylvain

On 2 sept. 2014, at 18:41, Mark Thomas  wrote:

> I've been looking at this again (anything to get a break from writing
> parsers for cookies) and chatting with some of the infra folks that look
> after the ASF's git repos.
> 
> There are a couple of things we need to do:
> a) decide how we want to organise development in git
> b) decide if we want to move to git
> 
> Now the decision we make for a) might influence some folks to make a
> different decision for b). On the other hand, there is no point debating
> a) if we are never going to move.
> 
> So, how do folks want to approach this?
> A: Vote to move to git and then figure out how best to use it? or
> B: Agree our git workflows and then have a vote on moving to git with
> those workflows?
> 
> I'm leaning towards A myself.
> 
> Mark
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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



Re: git (yet again)

2014-09-02 Thread Henri Gomez
Maven Strike back ?

That would be a very good new and our friend Olivier Lamy will be more than
happy :)


2014-09-02 18:52 GMT+02:00 Rémy Maucherat :

> 2014-09-02 18:41 GMT+02:00 Mark Thomas :
>
> > I'm leaning towards A myself.
> >
>
> Oh wow, does this mean I can resurrect my thread on Maven too ? (ideally,
> we should also move to it first, then think about how to use it later,
> otherwise people will never vote in favor)
>
> :)
>
> Rémy
>


Re: git (yet again)

2014-09-02 Thread Henri Gomez
About git workflow.

Github popularized fork/pull-request mode and it helped enrolled tons of
new developpers in many Git projects, in Github but not only.
Would it be something possible with current Git infra in ASF ?

Side note, did infra folks plans to use a new git hosting ?
Using Stash, Gitlab, Gitblit ? Or GitBucket (this implementation came from
an ASFer) ?



2014-09-02 18:41 GMT+02:00 Mark Thomas :

> I've been looking at this again (anything to get a break from writing
> parsers for cookies) and chatting with some of the infra folks that look
> after the ASF's git repos.
>
> There are a couple of things we need to do:
> a) decide how we want to organise development in git
> b) decide if we want to move to git
>
> Now the decision we make for a) might influence some folks to make a
> different decision for b). On the other hand, there is no point debating
> a) if we are never going to move.
>
> So, how do folks want to approach this?
> A: Vote to move to git and then figure out how best to use it? or
> B: Agree our git workflows and then have a vote on moving to git with
> those workflows?
>
> I'm leaning towards A myself.
>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[Bug 56857] Thread safety issue in ApplicationContextFacade.invokeMethod

2014-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56857

--- Comment #3 from Volker Kleinschmidt  ---
Thanks for the quick follow-up. Any chance this could get backported to 7.x?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



Re: git (yet again)

2014-09-02 Thread Mark Thomas
On 02/09/2014 19:24, Sylvain Laurent wrote:
> Regarding question b), I vote yes, whatever the organization of the 
> development
> 
> Regarding a), for my part I rather see something between A and B. I think of 
> the following questions that should be answered first :
> - will there be 1 repo per major version like the current SVN setup ? or only 
> branches in a unique repo ?

It is up to us.


The current svn setup is a single repo.


My preference is for a single git repo with branches for 7.0.x and 6.0.x

> - how to backport modifications from one major version to another ? is 
> cherry-picking ok ?

Again, it is up to us. I see two basic choices.

a) Make change in master and cherry pick to backport
b) Make changes in earliest branch that needs the change and merge
forward until we reach trunk/master

a) is closer to how we work now. b) is 'nicer'. a) is more flexible.

I have a slight preference for a) but I'm happy with either.

> - where will the main repo be (the one committers will push to)? ASF or 
> github ? where should we open and treat pull requests, ASF or github ? 
> (currently having the SVN repo at ASF and pull requests at github is not 
> convenient)

The canonical location for the source for an ASF project is ALWAYS the
ASF. The repo will be mirrored at github. The github integration makes
working with github pull requests very easy - we are doing this already.

Mark


> 
> Sylvain
> 
> On 2 sept. 2014, at 18:41, Mark Thomas  wrote:
> 
>> I've been looking at this again (anything to get a break from writing
>> parsers for cookies) and chatting with some of the infra folks that look
>> after the ASF's git repos.
>>
>> There are a couple of things we need to do:
>> a) decide how we want to organise development in git
>> b) decide if we want to move to git
>>
>> Now the decision we make for a) might influence some folks to make a
>> different decision for b). On the other hand, there is no point debating
>> a) if we are never going to move.
>>
>> So, how do folks want to approach this?
>> A: Vote to move to git and then figure out how best to use it? or
>> B: Agree our git workflows and then have a vote on moving to git with
>> those workflows?
>>
>> I'm leaning towards A myself.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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



Re: git (yet again)

2014-09-02 Thread Mark Thomas
On 02/09/2014 19:31, Henri Gomez wrote:
> About git workflow.
> 
> Github popularized fork/pull-request mode and it helped enrolled tons of
> new developpers in many Git projects, in Github but not only.
> Would it be something possible with current Git infra in ASF ?

The git repo would be mirrored at github. Folks can open pull requests
at gitbuh now and we can close them when we commit the changes. That
won't change if we switch to git.

> Side note, did infra folks plans to use a new git hosting ?
> Using Stash, Gitlab, Gitblit ? Or GitBucket (this implementation came from
> an ASFer) ?

No plans to change current arrangement.

Mark

> 
> 
> 
> 2014-09-02 18:41 GMT+02:00 Mark Thomas :
> 
>> I've been looking at this again (anything to get a break from writing
>> parsers for cookies) and chatting with some of the infra folks that look
>> after the ASF's git repos.
>>
>> There are a couple of things we need to do:
>> a) decide how we want to organise development in git
>> b) decide if we want to move to git
>>
>> Now the decision we make for a) might influence some folks to make a
>> different decision for b). On the other hand, there is no point debating
>> a) if we are never going to move.
>>
>> So, how do folks want to approach this?
>> A: Vote to move to git and then figure out how best to use it? or
>> B: Agree our git workflows and then have a vote on moving to git with
>> those workflows?
>>
>> I'm leaning towards A myself.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>
> 


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



Re: git (yet again)

2014-09-02 Thread Henri Gomez
>The git repo would be mirrored at github. Folks can open pull requests
>at gitbuh now and we can close them when we commit the changes. That
>won't change if we switch to git.

There is mecansims to merge pull-requests for GitHub in Git ASF ?
How is documented somewhere ?


> > Side note, did infra folks plans to use a new git hosting ?
> > Using Stash, Gitlab, Gitblit ? Or GitBucket (this implementation came
> from
> > an ASFer) ?
>

> No plans to change current arrangement.

Ok, no problems


Re: git (yet again)

2014-09-02 Thread Filip Hanik
On Tue, Sep 2, 2014 at 10:52 AM, Rémy Maucherat  wrote:

> 2014-09-02 18:41 GMT+02:00 Mark Thomas :
>
> > I'm leaning towards A myself.
>

​
The move to git clears a huge hurdle, and that is managing contributions.
The patch system is very difficult, and impossible to maintain. A pull
request stays alive
​ and can be maintained through code changes​
. I believe we can get more contributions by moving to Git.
​


> >
>
> Oh wow, does this mean I can resurrect my thread on Maven too ? (ideally,
> we should also move to it first, then think about how to use it later,
> otherwise people will never vote in favor)
>

​Let's skip Maven and move straight to Gradle, it has the benefit of not
needing a build system installed on the developers machine, as it gets
downloaded by the wrapper checked into the repo. This is yet one less
version that is required by the contributor.
It's built on top of Ant, and should give us all the flexibility we need.​


>
> :)
>
> Rémy
>


Re: git (yet again)

2014-09-02 Thread Konstantin Kolinko
2014-09-02 20:41 GMT+04:00 Mark Thomas :
> I've been looking at this again (anything to get a break from writing
> parsers for cookies) and chatting with some of the infra folks that look
> after the ASF's git repos.
>
> There are a couple of things we need to do:
> a) decide how we want to organise development in git
> b) decide if we want to move to git
>
> Now the decision we make for a) might influence some folks to make a
> different decision for b). On the other hand, there is no point debating
> a) if we are never going to move.
>
> So, how do folks want to approach this?
> A: Vote to move to git and then figure out how best to use it? or
> B: Agree our git workflows and then have a vote on moving to git with
> those workflows?
>
> I'm leaning towards A myself.

We shall discuss the workflows and our expectations first.

In July I successfully configured Git to operate on the same set of
files as Subversion, on Windows.

That is: I have a sparse subversion workng copy  that spans the whole
of site/trunk, tc6.0.x/trunk, tc7.0.x/trunk and trunk,  and I have
".git" directories in each of the branches.

It works. If both Git and Subversion data are up-to-date, the "status"
command in both shows no changes (except an occasional uncommitted
bin/tcnative-1.dll that is used to run JUnit tests with APR).

As such, I use Git to prepare sets of changes and use Subversion
client to commit them when they are ready.

Technical bits:

1. I am using TortoiseGit (64-bit) and msysGit (32-bit).

2. I cloned the repositories from git://git.apache.org/

3. I have not initialized "git-svn" on this repository. I do not use it.

4. I have eol-conversion options turned off (the default) and I have
.git/info/attributes  files in my local repositories that configure
Git to apply "text" attribute to the same set of files that are
treated as textual () in build.xml,  the
same ones that have svn:eol-style=native in Subversion.

5. To pull fresh changes one has to update both subversion wc and
local git repository. Both "svn, git" and "git, svn" update sequences
do work successfully.

I prefer "svn, git", because it works a bit better and because git
repository lags behind subversion one.

6. To update the local trunk branch in Git according to master
repository the following works:
a) "Git Sync" command in TortoiseGit, using "Fetch and Rebase" operation there
b) In command line (Git Shell) it maps to the following sequence of commands:
git stash -u
git pull --rebase --verbose
git stash pop

Impressions etc.

1. Such workflow works. It is great for building up experience with the tool.

It also allows us to discuss Mark's "a) decide how we want to organise
development in git"  point, without actually moving to Git.

I think I can document it on a Wiki page, if others are interested.

I used this workflow to prepare some patches when I had no network
access (traveling on a train across some sticks) and to commit them
when I had access.


2. An annoying fact is that the Git repository at git.apache.org lags
for up to one hour behind the Subversion one.

The symptoms are as if the "git svn pull" is performed via some cron
job, instead of a postcommit hook or svn-pub-sub.  I wonder whether
the Infra team can make it work better.


3. I would like to commit my ".git/info/attributes" file as
".gitattributes" into Subversion.

My concerns before committing it:
a) If any of you are using Git on Windows, such commit probably means
that you have to "git checkout trunk" a fresh set of files so that
they get CRLF line ends applied from this setting.

b) I do not know whether this interoperates with git-svn, if any of
you are using it. We may give it a try and rollback later.  In any
case, if there is anything wrong, a local ".git/info/attributes" file
can be used to overwrite the setting, as it has precedence over the
repository-provided ".gitattributes" one.

Documentation:
https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

At the same time. I think it would be good to commit an svn:auto-props
property that applies svn:eol-style=native for the same set of files
for Subversion clients.

By the way Apache Subversion project configured a svn:auto-props
property for their project today,
http://svn.apache.org/r1621946


4. My impression is that Git works slower.

Maybe it is no so optimized, has less optimal database structure, or
does more work.

5. I think that now I will be able to continue working on Tomcat if we
migrate to Git,
but I am not yet convinced that it is worth moving,
and several issues listed below have to be fixed before the move.

My points from the previous thread on this topic:
http://markmail.org/message/m7ig5a7wunyewdy6

Areas where we depend on Subversion and need to implement a fix before the move:
1). There is svn externals reference from Tomcat Native to Tomcat Trunk.

(Does it mean that we have to migrate TC Native to Git at the same time?
Can we remove this svn externals 

Re: git (yet again)

2014-09-02 Thread sebb
On 2 September 2014 20:25, Filip Hanik  wrote:
> On Tue, Sep 2, 2014 at 10:52 AM, Rémy Maucherat  wrote:
>
>> 2014-09-02 18:41 GMT+02:00 Mark Thomas :
>>
>> > I'm leaning towards A myself.
>>
>
>
> The move to git clears a huge hurdle, and that is managing contributions.
> The patch system is very difficult, and impossible to maintain. A pull
> request stays alive
> and can be maintained through code changes
> . I believe we can get more contributions by moving to Git.
>
>
>
>> >
>>
>> Oh wow, does this mean I can resurrect my thread on Maven too ? (ideally,
>> we should also move to it first, then think about how to use it later,
>> otherwise people will never vote in favor)
>>
>
> Let's skip Maven and move straight to Gradle, it has the benefit of not
> needing a build system installed on the developers machine, as it gets
> downloaded by the wrapper checked into the repo. This is yet one less

AIUI the wrapper is not source, it is binary.
Generally only source code is allowed in repos, so will this cause an issue?

> version that is required by the contributor.
> It's built on top of Ant, and should give us all the flexibility we need.
>
>
>>
>> :)
>>
>> Rémy
>>

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



Re: git (yet again)

2014-09-02 Thread Henri Gomez
> Let's skip Maven and move straight to Gradle, it has the benefit of not
> needing a build system installed on the developers machine, as it gets
> downloaded by the wrapper checked into the repo. This is yet one less
> version that is required by the contributor.
> It's built on top of Ant, and should give us all the flexibility we need.
>

Maven is used by so many ASF projects and especially projects using Tomcat
like TomEE, it would be nice to share contents and expertises.
Also, Maven is way more used in companies than Gradle or Ant/Ivy.
It should help also for companies (or companies developpers) contribution.


Re: git (yet again)

2014-09-02 Thread Violeta Georgieva
Hi,


2014-09-02 22:15 GMT+03:00 Mark Thomas :
>
> ...
> It is up to us.
>
> 
> The current svn setup is a single repo.
> 
>
> My preference is for a single git repo with branches for 7.0.x and 6.0.x

+1 one repo with many branches
master is the latest development in our case 8.0.x at the moment

>
> > - how to backport modifications from one major version to another ? is
cherry-picking ok ?
>
> Again, it is up to us. I see two basic choices.
>
> a) Make change in master and cherry pick to backport

+1 cherry pick from master to other branches

> b) Make changes in earliest branch that needs the change and merge
> forward until we reach trunk/master
>
> a) is closer to how we work now. b) is 'nicer'. a) is more flexible.
>
> I have a slight preference for a) but I'm happy with either.
>

2014-09-02 22:28 GMT+03:00 Konstantin Kolinko :
>
> ...
> 2). svn revision numbers are used by the config difference form in the
> Migration guide.
> http://tomcat.apache.org/migration-8.html#Upgrading_8.0.x
>
> (Is it possible to replace it with links to similar Git tools, e.g. to
> "compare" pages on GitHub? Does HTML GUI at git.apache.org have
> similar history and compare pages?)
>

https://github.com/apache/tomcat/compare


Regards,
Violeta


Re: git (yet again)

2014-09-02 Thread Violeta Georgieva
2014-09-02 23:22 GMT+03:00 Violeta Georgieva :
>
> Hi,
>
>
> 2014-09-02 22:15 GMT+03:00 Mark Thomas :
> >
> > ...
>
> > It is up to us.
> >
> > 
> > The current svn setup is a single repo.
> > 
> >
> > My preference is for a single git repo with branches for 7.0.x and 6.0.x
>
> +1 one repo with many branches
> master is the latest development in our case 8.0.x at the moment
>
> >
> > > - how to backport modifications from one major version to another ?
is cherry-picking ok ?
> >
> > Again, it is up to us. I see two basic choices.
> >
> > a) Make change in master and cherry pick to backport
>
> +1 cherry pick from master to other branches
>
> > b) Make changes in earliest branch that needs the change and merge
> > forward until we reach trunk/master
> >
> > a) is closer to how we work now. b) is 'nicer'. a) is more flexible.
> >
> > I have a slight preference for a) but I'm happy with either.
> >
>
> 2014-09-02 22:28 GMT+03:00 Konstantin Kolinko :
> >
> > ...
> > 2). svn revision numbers are used by the config difference form in the
> > Migration guide.
> > http://tomcat.apache.org/migration-8.html#Upgrading_8.0.x
> >
> > (Is it possible to replace it with links to similar Git tools, e.g. to
> > "compare" pages on GitHub? Does HTML GUI at git.apache.org have
> > similar history and compare pages?)
> >
>
> https://github.com/apache/tomcat/compare


One more thing - in github you can make inline comments for a given
commit/pull request.
This is very convenient for a review purposes.

>
>
> Regards,
> Violeta


Re: git (yet again)

2014-09-02 Thread Rémy Maucherat
2014-09-02 22:49 GMT+02:00 Violeta Georgieva :

> One more thing - in github you can make inline comments for a given
> commit/pull request.
> This is very convenient for a review purposes.
>

Well, I guess since it is mirrored in github, you can comment there.

About the patching process, I would vote a) Make change in master and
cherry pick to backport.

For Maven, it was a joke, sorry for hijacking the thread. It should be
revisited later (or never). One last note: IMO Gradle sounds better, but
the point is to help integration so Maven is likely more useful.

Rémy


svn commit: r1622163 - in /tomcat/trunk: java/org/apache/tomcat/util/descriptor/web/WebXml.java webapps/docs/changelog.xml

2014-09-02 Thread violetagg
Author: violetagg
Date: Wed Sep  3 05:36:04 2014
New Revision: 1622163

URL: http://svn.apache.org/r1622163
Log:
Fixed the multipart elements merge operation performed during web application 
deployment. Identified by Coverity Scan.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/WebXml.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/WebXml.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/WebXml.java?rev=1622163&r1=1622162&r2=1622163&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/WebXml.java Wed Sep 
 3 05:36:04 2014
@@ -2082,7 +2082,7 @@ public class WebXml {
 
 if (dest.getMaxFileSize() == null) {
 dest.setMaxFileSize(src.getMaxFileSize());
-} else if (src.getLocation() != null) {
+} else if (src.getMaxFileSize() != null) {
 if (failOnConflict &&
 !src.getMaxFileSize().equals(dest.getMaxFileSize())) {
 return false;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1622163&r1=1622162&r2=1622163&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Sep  3 05:36:04 2014
@@ -84,6 +84,10 @@
 with new Context options to select and configure it. This parser is
 currently considered experiemental and is not used by default. (markt)
   
+  
+Fixed the multipart elements merge operation performed during web
+application deployment. Identified by Coverity Scan. (violetagg)
+  
 
   
   



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



svn commit: r1622164 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/deploy/WebXml.java webapps/docs/changelog.xml

2014-09-02 Thread violetagg
Author: violetagg
Date: Wed Sep  3 05:42:53 2014
New Revision: 1622164

URL: http://svn.apache.org/r1622164
Log:
Merged revision 1622163 from tomcat/trunk:
Fixed the multipart elements merge operation performed during web application 
deployment. Identified by Coverity Scan.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/deploy/WebXml.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1622163

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/deploy/WebXml.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/deploy/WebXml.java?rev=1622164&r1=1622163&r2=1622164&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/deploy/WebXml.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/deploy/WebXml.java Wed Sep  3 
05:42:53 2014
@@ -2231,7 +2231,7 @@ public class WebXml {
 
 if (dest.getMaxFileSize() == null) {
 dest.setMaxFileSize(src.getMaxFileSize());
-} else if (src.getLocation() != null) {
+} else if (src.getMaxFileSize() != null) {
 if (failOnConflict &&
 !src.getMaxFileSize().equals(dest.getMaxFileSize())) {
 return false;

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1622164&r1=1622163&r2=1622164&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep  3 05:42:53 2014
@@ -102,6 +102,10 @@
 56882: Add testcase for processing of forwards and includes
 when Context have been reloaded. (kkolinko)
   
+  
+Fixed the multipart elements merge operation performed during web
+application deployment. Identified by Coverity Scan. (violetagg)
+  
 
   
   



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



svn commit: r1622166 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/StandardContext.java test/org/apache/catalina/core/TestStandardContext.java webapps/docs/changelog.xml

2014-09-02 Thread violetagg
Author: violetagg
Date: Wed Sep  3 06:05:58 2014
New Revision: 1622166

URL: http://svn.apache.org/r1622166
Log:
Merged revision 1621731 from tomcat/trunk:
Correct the return value for StandardContext.getResourceOnlyServlets()
so that multiple names are separated by commas. Identified by Coverity
Scan and fixed based on a patch by Felix Schumacher.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1621731

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1622166&r1=1622165&r2=1622166&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Wed 
Sep  3 06:05:58 2014
@@ -984,7 +984,9 @@ public class StandardContext extends Con
 StringBuilder result = new StringBuilder();
 boolean first = true;
 for (String servletName : resourceOnlyServlets) {
-if (!first) {
+if (first) {
+first = false;
+} else {
 result.append(',');
 }
 result.append(servletName);

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=1622166&r1=1622165&r2=1622166&view=diff
==
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java 
(original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java 
Wed Sep  3 06:05:58 2014
@@ -68,6 +68,7 @@ import org.apache.catalina.startup.Tomca
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.tomcat.util.buf.ByteChunk;
 
+
 public class TestStandardContext extends TomcatBaseTest {
 
 private static final String REQUEST =
@@ -859,4 +860,13 @@ public class TestStandardContext extends
 }
 
 }
+
+@Test
+public void testBug56903() {
+Context context = new StandardContext();
+
+String list = "a,b,c";
+context.setResourceOnlyServlets(list);
+Assert.assertEquals(list, context.getResourceOnlyServlets());
+}
 }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1622166&r1=1622165&r2=1622166&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep  3 06:05:58 2014
@@ -103,6 +103,12 @@
 when Context have been reloaded. (kkolinko)
   
   
+56903: Correct the return value for
+StandardContext.getResourceOnlyServlets() so that multiple
+names are separated by commas. Identified by Coverity Scan and fixed
+based on a patch by Felix Schumacher. (markt)
+  
+  
 Fixed the multipart elements merge operation performed during web
 application deployment. Identified by Coverity Scan. (violetagg)
   



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



Re: svn commit: r1622166 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/StandardContext.java test/org/apache/catalina/core/TestStandardContext.java webapps/docs/changelog.xml

2014-09-02 Thread Felix Schumacher


On 3. September 2014 08:05:59 MESZ, violet...@apache.org wrote:
>Author: violetagg
>Date: Wed Sep  3 06:05:58 2014
>New Revision: 1622166
>
>URL: http://svn.apache.org/r1622166
>Log:
>Merged revision 1621731 from tomcat/trunk:
>Correct the return value for StandardContext.getResourceOnlyServlets()
>so that multiple names are separated by commas. Identified by Coverity
>Scan and fixed based on a patch by Felix Schumacher.
>
>Modified:
>tomcat/tc7.0.x/trunk/   (props changed)
>tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
>tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
>tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
>Propchange: tomcat/tc7.0.x/trunk/
>--
>  Merged /tomcat/trunk:r1621731
>
>Modified:
>tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
>URL:
>http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1622166&r1=1622165&r2=1622166&view=diff
>==
>---
>tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
>(original)
>+++
>tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
>Wed Sep  3 06:05:58 2014
>@@ -984,7 +984,9 @@ public class StandardContext extends Con
> StringBuilder result = new StringBuilder();
> boolean first = true;
> for (String servletName : resourceOnlyServlets) {
>-if (!first) {
>+if (first) {
>+first = false;
>+} else {
> result.append(',');
> }
> result.append(servletName);
>
>Modified:
>tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
>URL:
>http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=1622166&r1=1622165&r2=1622166&view=diff
>==
>---
>tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
>(original)
>+++
>tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java
>Wed Sep  3 06:05:58 2014
>@@ -68,6 +68,7 @@ import org.apache.catalina.startup.Tomca
> import org.apache.catalina.startup.TomcatBaseTest;
> import org.apache.tomcat.util.buf.ByteChunk;
> 
>+
> public class TestStandardContext extends TomcatBaseTest {
> 
> private static final String REQUEST =
>@@ -859,4 +860,13 @@ public class TestStandardContext extends
> }
> 
> }
>+
>+@Test
>+public void testBug56903() {
>+Context context = new StandardContext();
>+
>+String list = "a,b,c";
>+context.setResourceOnlyServlets(list);
>+Assert.assertEquals(list, context.getResourceOnlyServlets());
>+}
This will probably not work. At least in trunk the string is generated of a set 
and thus will not always be sorted. So you either have to sort it or just check 
wether a, b and c are in the result.

Regards
Felix
> }
>
>Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>URL:
>http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1622166&r1=1622165&r2=1622166&view=diff
>==
>--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
>+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep  3 06:05:58
>2014
>@@ -103,6 +103,12 @@
> when Context have been reloaded. (kkolinko)
>   
>   
>+56903: Correct the return value for
>+StandardContext.getResourceOnlyServlets() so that
>multiple
>+names are separated by commas. Identified by Coverity Scan and
>fixed
>+based on a patch by Felix Schumacher. (markt)
>+  
>+  
>  Fixed the multipart elements merge operation performed during web
>   application deployment. Identified by Coverity Scan. (violetagg)
>   
>
>
>
>-
>To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: dev-h...@tomcat.apache.org


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