svn commit: r1634228 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/tomcat/util/http/mapper/Mapper.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 14:02:00 2014
New Revision: 1634228

URL: http://svn.apache.org/r1634228
Log:
Fix generics warnings in Mapper.
It is just some local variables. No change in functionality or APIs.

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1634228&r1=1634227&r2=1634228&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Oct 25 14:02:00 2014
@@ -48,15 +48,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko, markt
   -1:
 
-* Fix generics warnings in Mapper.
-
-  Motivation: Resolve IDE warnings to make it easier to spot more serious
-  errors when working on this class.
-  It is just some local variables. No change in functionality or APIs.
-  
https://people.apache.org/~kkolinko/patches/2014-06-23_tc6_Mapper_generics.patch
-  +1: kkolinko, markt, schultz
-  -1:
-
 * Mitigate POODLE by disabling SSLv3 by default for JSSE
   http://people.apache.org/~markt/patches/2014-10-21-poodle-tc6-v2.patch
   +1: markt, schultz

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java?rev=1634228&r1=1634227&r2=1634228&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java 
Sat Oct 25 14:02:00 2014
@@ -289,7 +289,7 @@ public final class Mapper {
  * @return The context names
  */
 public String[] getContextNames() {
-List list=new ArrayList();
+List list = new ArrayList();
 for( int i=0; i list = new ArrayList();
 if( host==null ) host="";
 if( context==null ) context="";
 for( int i=0; i

svn commit: r1634229 - /tomcat/trunk/webapps/docs/config/http.xml

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 14:16:13 2014
New Revision: 1634229

URL: http://svn.apache.org/r1634229
Log:
Correct documentation typo.
Add trailing dots in sentences. There are five protocols now.

Modified:
tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1634229&r1=1634228&r2=1634229&view=diff
==
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Sat Oct 25 14:16:13 2014
@@ -603,19 +603,19 @@
   
   
 (int)The first value for the performance settings. See
-http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
   
 (int)The second value for the performance settings. See
-http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
   
 (int)The third value for the performance settings. See
-http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
@@ -1371,7 +1371,7 @@
   value is all, which is equivalent to 
TLSv1+TLSv1.1+TLSv1.2
   with other acceptable values being SSLv2,
   SSLv3, TLSv1, TLSv1.1, 
TLSv1.2
-  and any combination of the three protocols concatenated with a plus sign.
+  and any combination of these protocols concatenated with a plus sign.
   Note that both protocols SSLv2 and SSLv3 are
   inherently unsafe.
 



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



svn commit: r1634230 - in /tomcat/tc7.0.x/trunk: ./ webapps/docs/config/http.xml

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 14:20:28 2014
New Revision: 1634230

URL: http://svn.apache.org/r1634230
Log:
Correct documentation typo.
Add trailing dots in sentences. There are five protocols now.

Merged r1634229 from tomcat/trunk.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml

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

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml?rev=1634230&r1=1634229&r2=1634230&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml Sat Oct 25 14:20:28 2014
@@ -598,19 +598,19 @@
   
   
 (int)The first value for the performance settings. See
-http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
   
 (int)The second value for the performance settings. See
-http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
   
 (int)The third value for the performance settings. See
-http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options
+http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options.
 All three performance attributes must be set else the JVM defaults will
 be used for all three.
   
@@ -1246,7 +1246,7 @@
   value is all, which is equivalent to 
TLSv1+TLSv1.1+TLSv1.2
   with other acceptable values being SSLv2,
   SSLv3, TLSv1, TLSv1.1, 
TLSv1.2
-  and any combination of the three protocols concatenated with a plus sign.
+  and any combination of these protocols concatenated with a plus sign.
   Note that both protocols SSLv2 and SSLv3 are
   inherently unsafe.
 



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



svn commit: r1634231 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 14:23:24 2014
New Revision: 1634231

URL: http://svn.apache.org/r1634231
Log:
Update. All issue were resolved in v2 of the patch.

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1634231&r1=1634230&r2=1634231&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Oct 25 14:23:24 2014
@@ -93,27 +93,6 @@ PATCHES PROPOSED TO BACKPORT:
   http://people.apache.org/~schultz/patches/53952.tc6.patch.2
   +1: schultz, kkolinko
   -1:
-   kkolinko:
-1) It depends on a newer TC-Native. The "ALL" value of protocol
-(default) will break if it is run with an older version.
-As such, it needs to wait until TC-Native is released and it needs bump
-in recommended/required TC-Native version in AprLifecycleListener.
-Such bump may be addressed as a separate proposal.
-
-2) Documentation patch is off.
-The "SSLCACertificateFile" and other properties are documented in
-Tomcat 6 in docs/apr.html
-(In Tomcat 7 they were moved to config/http.html, config/ajp.html for
-consistency, but that move have not been ported to Tomcat 6
-documentation yet. OK to backport that if you have time. Docs are CTR.
-But I am -1 to documenting it twice in new and old place like the
-proposed patch does.)
-
-3) In documentation "and any combination of the three protocols"
-
-There are five protocols now.
-
-4) Changelog part of the patch breaks XML. Tags are not paired.
 
 PATCHES/ISSUES THAT ARE STALLED:
 



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



svn commit: r1634233 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 14:58:19 2014
New Revision: 1634233

URL: http://svn.apache.org/r1634233
Log:
proposal

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1634233&r1=1634232&r2=1634233&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Oct 25 14:58:19 2014
@@ -94,6 +94,15 @@ PATCHES PROPOSED TO BACKPORT:
   +1: schultz, kkolinko
   -1:
 
+* Update to Tomcat Native 1.1.32
+  I do not change versions in AprLifecycleListener. Changing
+  "recommended" version (TCN_RECOMMENDED_PV) is covered by schultz's BZ
+  53952 patch above and I think that there is no pressing need to change
+  the "required" version.
+  https://people.apache.org/~kkolinko/patches/2014-10-25_tc6_native1132.patch
+  +1: kkolinko
+  -1:
+
 PATCHES/ISSUES THAT ARE STALLED:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44312



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



[Bug 57132] ImportHandler.resolveClass() fails to report conflicting import when called repeatedly

2014-10-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57132

--- Comment #6 from Konstantin Kolinko  ---
(In reply to Christopher Schultz from comment #5)
> 
> I haven't read through the code to see how class object references are
> maintained, but I have been bitten in the past when
> Foo.class.getMethod("bar").getName() == Foo.class.getMethod("bar").getName()
> yields false.
> 
> Perhaps clazz.equals(conflict) would be better than == in this case?

Mark's fix in r1633810 used conflict.equals(clazz), so it is OK.


The JVM specification (Java 8 edition) in chapter 5.3 Creation and Loading
and Java Language Specification (Java 8 edition) in chapter 12.2 Loading of
Classes and Interfaces both contain the same phrase:

"Given the same name, a good class loader should always return the same Class
object."

-- 
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: r1634250 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 19:56:23 2014
New Revision: 1634250

URL: http://svn.apache.org/r1634250
Log:
Correct line wrap - followup to r1622251

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1634250&r1=1634249&r2=1634250&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
Sat Oct 25 19:56:23 2014
@@ -309,7 +309,8 @@ public class WsServerContainer extends W
 }
 if (!success) {
 log.warn(sm.getString("serverContainer.threadGroupNotDestroyed",
-threadGroup.getName(), Integer.valueOf(threadCount))); 
   }
+threadGroup.getName(), Integer.valueOf(threadCount)));
+}
 }
 
 



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



svn commit: r1634251 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/WsServerContainer.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 20:06:45 2014
New Revision: 1634251

URL: http://svn.apache.org/r1634251
Log:
Correct line wrap - followup to r1622253
Merged r1634250 from tomcat/trunk.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1634251&r1=1634250&r2=1634251&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 Sat Oct 25 20:06:45 2014
@@ -311,7 +311,8 @@ public class WsServerContainer extends W
 }
 if (!success) {
 log.warn(sm.getString("serverContainer.threadGroupNotDestroyed",
-threadGroup.getName(), Integer.valueOf(threadCount))); 
   }
+threadGroup.getName(), Integer.valueOf(threadCount)));
+}
 }
 
 



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



[Bug 57135] ImportHandler shall ignore non-public classes

2014-10-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57135

Konstantin Kolinko  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #2 from Konstantin Kolinko  ---
(In reply to Mark Thomas from comment #1)
> I'm guessing you mean spurious rather than spirituous/spiritual.

I meant unexpected and mysterious.

> I agree the text in the spec is likely to be wrong but the text is clear. I
> suggest we seek clarification from the EG before continuing else we risk
> different behaviour in different implementations.

OK. I am changing status to NEEDINFO for now.

I think that if there are both public and non-public class from package
imports, we would be pretty safe to prefer the public class.

-- 
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: r1634257 - /tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 22:31:47 2014
New Revision: 1634257

URL: http://svn.apache.org/r1634257
Log:
Test for BZ 54928: use logging instead of System.err.

Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1634257&r1=1634256&r2=1634257&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Sat 
Oct 25 22:31:47 2014
@@ -307,8 +307,9 @@ public class TestCoyoteAdapter extends T
 
 for (int i = 0; i < 10; i++) {
 String line = client.readLine();
-if (line != null && line.length() > 20)
-System.err.println(line.subSequence(0, 20) + "...");
+if (line != null && line.length() > 20) {
+log.info(line.subSequence(0, 20) + "...");
+}
 }
 
 client.disconnect();
@@ -319,13 +320,13 @@ public class TestCoyoteAdapter extends T
 Thread.sleep(250);
 count ++;
 }
-System.err.println("Waited for servlet thread to stop for "
-+ (count * 250) + " ms");
+log.info("Waited for servlet thread to stop for " + (count * 250)
++ " ms");
 
 Assert.assertTrue(servlet.isCompleted());
 }
 
-private static class AsyncServlet extends HttpServlet {
+private class AsyncServlet extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
 
@@ -370,7 +371,7 @@ public class TestCoyoteAdapter extends T
 os.flush();
 Thread.sleep(1000);
 } catch (Exception e) {
-System.err.println("Exception caught " + 
e.getMessage());
+log.info("Exception caught " + e.getMessage());
 try {
 // Note if request times out before this
 // exception is thrown and the complete call



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



svn commit: r1634258 - /tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 23:15:50 2014
New Revision: 1634258

URL: http://svn.apache.org/r1634258
Log:
Write exception class, for better control.
(When I backport this test to Tomcat 7 the message in this exception is "null", 
but in Tomcat 8 it is some text. So let's see that what the exception class is).

Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1634258&r1=1634257&r2=1634258&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Sat 
Oct 25 23:15:50 2014
@@ -371,7 +371,7 @@ public class TestCoyoteAdapter extends T
 os.flush();
 Thread.sleep(1000);
 } catch (Exception e) {
-log.info("Exception caught " + e.getMessage());
+log.info("Exception caught " + e);
 try {
 // Note if request times out before this
 // exception is thrown and the complete call



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



svn commit: r1634259 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/connector/TestCoyoteAdapter.java test/org/apache/catalina/startup/SimpleHttpClient.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 23:23:51 2014
New Revision: 1634259

URL: http://svn.apache.org/r1634259
Log:
Backport test case for BZ 54928.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928

Merged revisions r1485862 r1486062 r1580030 r1580849 r1580869
r1590377 r1590402 r1590635 r1590638 r1633936 r1633974 r1634257 and r1634258.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged 
/tomcat/trunk:r1485862,1486062,1580030,1580849,1580869,1590377,1590402,1590635,1590638,1633936,1633974,1634257-1634258

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1634259&r1=1634258&r2=1634259&view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
Sat Oct 25 23:23:51 2014
@@ -18,8 +18,10 @@ package org.apache.catalina.connector;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.PrintWriter;
 
+import javax.servlet.AsyncContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
@@ -29,12 +31,26 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.buf.ByteChunk;
 
 public class TestCoyoteAdapter extends TomcatBaseTest {
 
+public static final String TEXT_8K;
+public static final byte[] BYTES_8K;
+
+static {
+StringBuilder sb = new StringBuilder(8192);
+for (int i = 0; i < 512; i++) {
+sb.append("0123456789ABCDEF");
+}
+TEXT_8K = sb.toString();
+BYTES_8K = TEXT_8K.getBytes(B2CConverter.UTF_8);
+}
 @Test
 public void testPathParmsRootNone() throws Exception {
 pathParamTest("/", "none");
@@ -255,4 +271,124 @@ public class TestCoyoteAdapter extends T
 pathInfo = req.getPathInfo();
 }
 }
+
+
+@Test
+public void testBug54928() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// Must have a real docBase - just use temp
+Context ctx =
+tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+
+AsyncServlet servlet = new AsyncServlet();
+Wrapper w = Tomcat.addServlet(ctx, "async", servlet);
+w.setAsyncSupported(true);
+ctx.addServletMapping("/async", "async");
+
+tomcat.start();
+
+SimpleHttpClient client = new SimpleHttpClient() {
+@Override
+public boolean isResponseBodyOK() {
+return true;
+}
+};
+
+String request = "GET /async HTTP/1.1" + SimpleHttpClient.CRLF +
+"Host: a" + SimpleHttpClient.CRLF + SimpleHttpClient.CRLF;
+
+client.setPort(getPort());
+client.setRequest(new String[] {request});
+
+client.connect();
+client.sendRequest();
+
+for (int i = 0; i < 10; i++) {
+String line = client.readLine();
+if (line != null && line.length() > 20) {
+log.info(line.subSequence(0, 20) + "...");
+}
+}
+
+client.disconnect();
+
+// Wait for server thread to stop
+int count = 0;
+while (servlet.getThread().isAlive() && count < 20) {
+Thread.sleep(250);
+count ++;
+}
+log.info("Waited for servlet thread to stop for " + (count * 250)
++ " ms");
+
+Assert.assertTrue(servlet.isCompleted());
+}
+
+private class AsyncServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+// This is a hack that won't work generally as servlets are expected to
+// handle more than one request.
+private Thread t;
+private volatile boolean completed = false;
+
+public Thread getThread() {
+return t;
+}
+
+public boolean isCompleted() {
+return completed;
+}
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+
+re

[Bug 54928] IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING]

2014-10-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928

--- Comment #8 from Konstantin Kolinko  ---
(In reply to comment #4)
> I'm re-opening this to make this change for 7.0.41

I backported the test case to Tomcat 7 in r1634259. The test case passes
successfully.

-- 
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: r1634260 - /tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 23:47:53 2014
New Revision: 1634260

URL: http://svn.apache.org/r1634260
Log:
Improve test for BZ 54928: Cut down wait time by using Thread.join(time) 
instead of Thread.sleep().

The actual wait time after the change becomes 2s instead of 250ms.

Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1634260&r1=1634259&r2=1634260&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Sat 
Oct 25 23:47:53 2014
@@ -315,13 +315,17 @@ public class TestCoyoteAdapter extends T
 client.disconnect();
 
 // Wait for server thread to stop
-int count = 0;
-while (servlet.getThread().isAlive() && count < 20) {
-Thread.sleep(250);
-count ++;
+Thread t = servlet.getThread();
+long startTime = System.nanoTime();
+for (int count = 0; t.isAlive() && count < 20; count++) {
+t.join(250);
+if (!t.isAlive()) {
+break;
+}
 }
-log.info("Waited for servlet thread to stop for " + (count * 250)
-+ " ms");
+long endTime = System.nanoTime();
+log.info("Waited for servlet thread to stop for "
++ (endTime - startTime) / 100 + " ms");
 
 Assert.assertTrue(servlet.isCompleted());
 }



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



svn commit: r1634261 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/connector/TestCoyoteAdapter.java

2014-10-25 Thread kkolinko
Author: kkolinko
Date: Sat Oct 25 23:52:36 2014
New Revision: 1634261

URL: http://svn.apache.org/r1634261
Log:
Improve test for BZ 54928: Cut down wait time by using Thread.join(time) 
instead of Thread.sleep().

The actual wait time after the change becomes 2s instead of 250ms.
Merged r1634260 from tomcat/trunk.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

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

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1634261&r1=1634260&r2=1634261&view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
Sat Oct 25 23:52:36 2014
@@ -315,13 +315,17 @@ public class TestCoyoteAdapter extends T
 client.disconnect();
 
 // Wait for server thread to stop
-int count = 0;
-while (servlet.getThread().isAlive() && count < 20) {
-Thread.sleep(250);
-count ++;
+Thread t = servlet.getThread();
+long startTime = System.nanoTime();
+for (int count = 0; t.isAlive() && count < 20; count++) {
+t.join(250);
+if (!t.isAlive()) {
+break;
+}
 }
-log.info("Waited for servlet thread to stop for " + (count * 250)
-+ " ms");
+long endTime = System.nanoTime();
+log.info("Waited for servlet thread to stop for "
++ (endTime - startTime) / 100 + " ms");
 
 Assert.assertTrue(servlet.isCompleted());
 }



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



[Bug 57144] New: Improve ClientAbortException.getMessage() to provide non-null message in Tomcat 7

2014-10-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57144

Bug ID: 57144
   Summary: Improve ClientAbortException.getMessage() to provide
non-null message in Tomcat 7
   Product: Tomcat 7
   Version: 7.0.56
  Hardware: PC
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com

For reference - r1634258 and r1360468

I was backporting a test for BZ 54928 from Tomcat 8 to Tomcat 7 and noted a
difference in output. The code was:

 log.info("Exception caught " + e.getMessage());

In Tomcat 7 (7.0.56+) it resulted in
 "Exception caught null"
while on Tomcat 8 (8.0.14+) it was
 "Exception caught Software caused connection abort: socket write error".

When I changed the code to use e.toString() it became:
in Tomcat 7:
 "Exception caught ClientAbortException:  java.net.SocketException: Software
caused connection abort: socket write error"
in Tomcat 8:
 "Exception caught org.apache.catalina.connector.ClientAbortException:
java.net.SocketException: Software caused connection abort: socket write error"


The difference comes from r1360468. Essentially Tomcat 8 delegates processing
to original implementations in java.lang.Throwable, while the old code in
Tomcat 7 has its own implementation of getMessage() and toString().

There are two differences:

a) The Throwable(Throwable cause) constructor in Java initializes message as
cause.toString() while in ClientAbortException(Throwable) the message defaults
to being null.

b) Throwable.toString() uses the fully qualified name of a class, while
ClientAbortException.toString() prints just "ClientAbortException".

-- 
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