[Bug 53391] CometEvent.close() doesn't close socket when called from different thread

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53391

--- Comment #10 from Mark Thomas ma...@apache.org ---
Glad to hear that all is OK. It wasn't a waste of time - the new test cases I
wrote for Comet are good to have.

-- 
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: r1349237 - in /tomcat/trunk/java/org/apache/catalina: ssi/SSIFlastmod.java ssi/SSIMediator.java util/DateTool.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 10:35:26 2012
New Revision: 1349237

URL: http://svn.apache.org/viewvc?rev=1349237view=rev
Log:
Deprecate pointless constant

Modified:
tomcat/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java
tomcat/trunk/java/org/apache/catalina/ssi/SSIMediator.java
tomcat/trunk/java/org/apache/catalina/util/DateTool.java

Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java?rev=1349237r1=1349236r2=1349237view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java Tue Jun 12 
10:35:26 2012
@@ -16,13 +16,13 @@
  */
 package org.apache.catalina.ssi;
 
-
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Date;
+import java.util.Locale;
 
-import org.apache.catalina.util.DateTool;
 import org.apache.catalina.util.Strftime;
+
 /**
  * Implements the Server-side #flastmod command
  *
@@ -72,7 +72,7 @@ public final class SSIFlastmod implement
 
 
 protected String formatDate(Date date, String configTimeFmt) {
-Strftime strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US);
+Strftime strftime = new Strftime(configTimeFmt, Locale.US);
 return strftime.format(date);
 }
 }
\ No newline at end of file

Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIMediator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIMediator.java?rev=1349237r1=1349236r2=1349237view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ssi/SSIMediator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/SSIMediator.java Tue Jun 12 
10:35:26 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.catalina.ssi;
 
-
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Date;
@@ -26,10 +25,10 @@ import java.util.Locale;
 import java.util.Set;
 import java.util.TimeZone;
 
-import org.apache.catalina.util.DateTool;
 import org.apache.catalina.util.Strftime;
 import org.apache.catalina.util.URLEncoder;
 import org.apache.tomcat.util.http.HttpMessages;
+
 /**
  * Allows the different SSICommand implementations to share data/talk to each
  * other
@@ -94,8 +93,7 @@ public class SSIMediator {
 
 public void setConfigTimeFmt(String configTimeFmt, boolean 
fromConstructor) {
 this.configTimeFmt = configTimeFmt;
-//What's the story here with DateTool.LOCALE_US?? Why??
-this.strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US);
+this.strftime = new Strftime(configTimeFmt, Locale.US);
 //Variables like DATE_LOCAL, DATE_GMT, and LAST_MODIFIED need to be
 // updated when
 //the timefmt changes. This is what Apache SSI does.

Modified: tomcat/trunk/java/org/apache/catalina/util/DateTool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/DateTool.java?rev=1349237r1=1349236r2=1349237view=diff
==
--- tomcat/trunk/java/org/apache/catalina/util/DateTool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/DateTool.java Tue Jun 12 
10:35:26 2012
@@ -36,7 +36,9 @@ public class DateTool {
 
 /**
  * US locale - all HTTP dates are in English
+ * @deprecated Use {@link Locale#US}
  */
+@Deprecated
 public static final Locale LOCALE_US = Locale.US;
 
 /**
@@ -75,7 +77,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat rfc1123Format = new 
ThreadLocalDateFormat() {
 @Override
 public DateFormat initialValue() {
-DateFormat result = new SimpleDateFormat(RFC1123_PATTERN, 
LOCALE_US);
+DateFormat result = new SimpleDateFormat(RFC1123_PATTERN, 
Locale.US);
 result.setTimeZone(GMT_ZONE);
 return result;
 }
@@ -87,7 +89,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat oldCookieFormat = new 
ThreadLocalDateFormat() {
 @Override
 public DateFormat initialValue() {
-DateFormat result = new SimpleDateFormat(OLD_COOKIE_PATTERN, 
LOCALE_US);
+DateFormat result = new SimpleDateFormat(OLD_COOKIE_PATTERN, 
Locale.US);
 result.setTimeZone(GMT_ZONE);
 return result;
 }
@@ -97,7 +99,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat rfc1036Format = new 
ThreadLocalDateFormat() {
 @Override
 public DateFormat initialValue() {
-DateFormat result = new SimpleDateFormat(rfc1036Pattern, 
LOCALE_US);
+DateFormat result = new SimpleDateFormat(rfc1036Pattern, 
Locale.US);
 result.setTimeZone(GMT_ZONE);
 return 

svn commit: r1349238 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ssi/SSIFlastmod.java java/org/apache/catalina/ssi/SSIMediator.java java/org/apache/catalina/util/DateTool.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 10:36:37 2012
New Revision: 1349238

URL: http://svn.apache.org/viewvc?rev=1349238view=rev
Log:
Deprecate pointless constant

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIMediator.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/DateTool.java

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java?rev=1349238r1=1349237r2=1349238view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIFlastmod.java Tue Jun 
12 10:36:37 2012
@@ -16,13 +16,13 @@
  */
 package org.apache.catalina.ssi;
 
-
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Date;
+import java.util.Locale;
 
-import org.apache.catalina.util.DateTool;
 import org.apache.catalina.util.Strftime;
+
 /**
  * Implements the Server-side #flastmod command
  * 
@@ -72,7 +72,7 @@ public final class SSIFlastmod implement
 
 
 protected String formatDate(Date date, String configTimeFmt) {
-Strftime strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US);
+Strftime strftime = new Strftime(configTimeFmt, Locale.US);
 return strftime.format(date);
 }
 }
\ No newline at end of file

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIMediator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIMediator.java?rev=1349238r1=1349237r2=1349238view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIMediator.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/ssi/SSIMediator.java Tue Jun 
12 10:36:37 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.catalina.ssi;
 
-
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Date;
@@ -26,10 +25,10 @@ import java.util.Locale;
 import java.util.Set;
 import java.util.TimeZone;
 
-import org.apache.catalina.util.DateTool;
 import org.apache.catalina.util.Strftime;
 import org.apache.catalina.util.URLEncoder;
 import org.apache.tomcat.util.http.HttpMessages;
+
 /**
  * Allows the different SSICommand implementations to share data/talk to each
  * other
@@ -94,8 +93,7 @@ public class SSIMediator {
 
 public void setConfigTimeFmt(String configTimeFmt, boolean 
fromConstructor) {
 this.configTimeFmt = configTimeFmt;
-//What's the story here with DateTool.LOCALE_US?? Why??
-this.strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US);
+this.strftime = new Strftime(configTimeFmt, Locale.US);
 //Variables like DATE_LOCAL, DATE_GMT, and LAST_MODIFIED need to be
 // updated when
 //the timefmt changes. This is what Apache SSI does.

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/DateTool.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/DateTool.java?rev=1349238r1=1349237r2=1349238view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/DateTool.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/DateTool.java Tue Jun 12 
10:36:37 2012
@@ -36,7 +36,9 @@ public class DateTool {
 
 /**
  * US locale - all HTTP dates are in English
+ * @deprecated Use {@link Locale#US}
  */
+@Deprecated
 public static final Locale LOCALE_US = Locale.US;
 
 /**
@@ -75,7 +77,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat rfc1123Format = new 
ThreadLocalDateFormat() {
 @Override
 public DateFormat initialValue() {
-DateFormat result = new SimpleDateFormat(RFC1123_PATTERN, 
LOCALE_US);
+DateFormat result = new SimpleDateFormat(RFC1123_PATTERN, 
Locale.US);
 result.setTimeZone(GMT_ZONE);
 return result;
 }
@@ -87,7 +89,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat oldCookieFormat = new 
ThreadLocalDateFormat() {
 @Override
 public DateFormat initialValue() {
-DateFormat result = new SimpleDateFormat(OLD_COOKIE_PATTERN, 
LOCALE_US);
+DateFormat result = new SimpleDateFormat(OLD_COOKIE_PATTERN, 
Locale.US);
 result.setTimeZone(GMT_ZONE);
 return result;
 }
@@ -97,7 +99,7 @@ public class DateTool {
 public static final ThreadLocalDateFormat rfc1036Format = new 

svn commit: r1349239 - /tomcat/trunk/java/org/apache/catalina/util/DateTool.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 10:36:58 2012
New Revision: 1349239

URL: http://svn.apache.org/viewvc?rev=1349239view=rev
Log:
Remove unused code

Modified:
tomcat/trunk/java/org/apache/catalina/util/DateTool.java

Modified: tomcat/trunk/java/org/apache/catalina/util/DateTool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/DateTool.java?rev=1349239r1=1349238r2=1349239view=diff
==
--- tomcat/trunk/java/org/apache/catalina/util/DateTool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/DateTool.java Tue Jun 12 
10:36:58 2012
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.util;
 
 import java.text.DateFormat;
@@ -35,13 +33,6 @@ import java.util.TimeZone;
 public class DateTool {
 
 /**
- * US locale - all HTTP dates are in English
- * @deprecated Use {@link Locale#US}
- */
-@Deprecated
-public static final Locale LOCALE_US = Locale.US;
-
-/**
  * GMT timezone - all HTTP dates are on GMT
  */
 public static final TimeZone GMT_ZONE = TimeZone.getTimeZone(GMT);



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



[Bug 53401] Request objects use too much memory!

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53401

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #1 from Mark Thomas ma...@apache.org ---
The InputBuffer may not be necessary in your use case, but it is required in
the general case both for performance and for pipe-lining.

WebSocket can and does use lighter weight objects and should be much more
scalable.

-- 
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: r1349263 - in /tomcat/trunk/java/org/apache: catalina/realm/RealmBase.java tomcat/spdy/NetSupportOpenSSL.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 11:26:51 2012
New Revision: 1349263

URL: http://svn.apache.org/viewvc?rev=1349263view=rev
Log:
Remove unused code (FindBugs)

Modified:
tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=1349263r1=1349262r2=1349263view=diff
==
--- tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java Tue Jun 12 
11:26:51 2012
@@ -1200,7 +1200,7 @@ public abstract class RealmBase extends 
 throw new IllegalArgumentException(uee.getMessage());
 }
 
-byte[] digest = null;
+byte[] digest;
 // Bugzilla 32137
 synchronized(md5Helper) {
 digest = md5Helper.digest(valueBytes);

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java?rev=1349263r1=1349262r2=1349263view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java Tue Jun 12 
11:26:51 2012
@@ -203,8 +203,6 @@ public class NetSupportOpenSSL extends S
 if (rd  0) {
 return -1;
 }
-off += rd;
-len -= rd;
 return rd;
 }
 }



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



svn commit: r1349281 - /tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 12:01:21 2012
New Revision: 1349281

URL: http://svn.apache.org/viewvc?rev=1349281view=rev
Log:
Refactoring has been completed in fix for BZ 48870

Modified:
tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml

Modified: tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml?rev=1349281r1=1349280r2=1349281view=diff
==
--- tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml (original)
+++ tomcat/trunk/res/findbugs/filter-post-7.0.x-fixes.xml Tue Jun 12 12:01:21 
2012
@@ -38,12 +38,6 @@
 Method name=writeObject /
 Bug code=Se /
   /Match
-  !-- Re-factor Integer constants to an enum --
-  Match
-Class name=org.apache.catalina.startup.ClassLoaderFactory /
-Method name=createClassLoader /
-Bug code=RC /
-  /Match
   !-- Re-factor to only have the thread running when an instance of the 
--
   !-- handler is active --
   Match



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



svn commit: r1349282 - /tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 12:01:43 2012
New Revision: 1349282

URL: http://svn.apache.org/viewvc?rev=1349282view=rev
Log:
Refactoring has been completed in fix for BZ 48870

Modified:
tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml

Modified: tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml?rev=1349282r1=1349281r2=1349282view=diff
==
--- tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml (original)
+++ tomcat/tc7.0.x/trunk/res/findbugs/filter-post-7.0.x-fixes.xml Tue Jun 12 
12:01:43 2012
@@ -38,12 +38,6 @@
 Method name=writeObject /
 Bug code=Se /
   /Match
-  !-- Re-factor Integer constants to an enum --
-  Match
-Class name=org.apache.catalina.startup.ClassLoaderFactory /
-Method name=createClassLoader /
-Bug code=RC /
-  /Match
   !-- Re-factor to only have the thread running when an instance of the 
--
   !-- handler is active --
   Match



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



svn commit: r1349298 - /tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 12:38:20 2012
New Revision: 1349298

URL: http://svn.apache.org/viewvc?rev=1349298view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52999
Remove synchronization bottleneck in container event handling

Modified:
tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1349298r1=1349297r2=1349298view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Tue Jun 12 
12:38:20 2012
@@ -180,7 +180,9 @@ public abstract class ContainerBase exte
 /**
  * The container event listeners for this Container.
  */
-protected ArrayListContainerListener listeners = new 
ArrayListContainerListener();
+protected ArrayListContainerListener listeners =
+new ArrayListContainerListener();
+protected ReadWriteLock listenersLock = new ReentrantReadWriteLock();
 
 
 /**
@@ -896,10 +898,13 @@ public abstract class ContainerBase exte
 @Override
 public void addContainerListener(ContainerListener listener) {
 
-synchronized (listeners) {
+Lock write = listenersLock.writeLock();
+write.lock();
+try {
 listeners.add(listener);
+} finally {
+write.unlock();
 }
-
 }
 
 
@@ -957,12 +962,15 @@ public abstract class ContainerBase exte
 @Override
 public ContainerListener[] findContainerListeners() {
 
-synchronized (listeners) {
+Lock read = listenersLock.readLock();
+read.lock();
+try {
 ContainerListener[] results =
 new ContainerListener[listeners.size()];
 return listeners.toArray(results);
+} finally {
+read.unlock();
 }
-
 }
 
 
@@ -1017,10 +1025,13 @@ public abstract class ContainerBase exte
 @Override
 public void removeContainerListener(ContainerListener listener) {
 
-synchronized (listeners) {
+Lock write = listenersLock.writeLock();
+write.lock();
+try {
 listeners.remove(listener);
+} finally {
+write.unlock();
 }
-
 }
 
 
@@ -1365,16 +1376,31 @@ public abstract class ContainerBase exte
 @Override
 public void fireContainerEvent(String type, Object data) {
 
-if (listeners.size()  1)
-return;
-ContainerEvent event = new ContainerEvent(this, type, data);
-ContainerListener list[] = new ContainerListener[0];
-synchronized (listeners) {
-list = listeners.toArray(list);
+/*
+ * Implementation note
+ * There are two options here.
+ * 1) Take a copy of listeners and fire the events outside of the read
+ *lock
+ * 2) Don't take a copy and fire the events inside the read lock
+ *
+ * Approach 2 has been used here since holding the read lock only
+ * prevents writes and that is preferable to creating lots of array
+ * objects. Since writes occur on start / stop (unless an external
+ * management tool is used) then holding the read lock for a relatively
+ * long time should not be an issue.
+ */
+Lock read = listenersLock.readLock();
+read.lock();
+try {
+if (listeners.size()  1)
+return;
+ContainerEvent event = new ContainerEvent(this, type, data);
+for (ContainerListener listener : listeners) {
+listener.containerEvent(event);
+}
+} finally {
+read.unlock();
 }
-for (int i = 0; i  list.length; i++)
-list[i].containerEvent(event);
-
 }
 
 



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



svn commit: r1349300 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ContainerBase.java webapps/docs/changelog.xml

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 12:40:00 2012
New Revision: 1349300

URL: http://svn.apache.org/viewvc?rev=1349300view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52999
Remove synchronization bottleneck in container event handling

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

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1349300r1=1349299r2=1349300view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java Tue 
Jun 12 12:40:00 2012
@@ -178,7 +178,9 @@ public abstract class ContainerBase exte
 /**
  * The container event listeners for this Container.
  */
-protected ArrayListContainerListener listeners = new 
ArrayListContainerListener();
+protected ArrayListContainerListener listeners =
+new ArrayListContainerListener();
+protected ReadWriteLock listenersLock = new ReentrantReadWriteLock();
 
 
 /**
@@ -914,10 +916,13 @@ public abstract class ContainerBase exte
 @Override
 public void addContainerListener(ContainerListener listener) {
 
-synchronized (listeners) {
+Lock write = listenersLock.writeLock();
+write.lock();
+try {
 listeners.add(listener);
+} finally {
+write.unlock();
 }
-
 }
 
 
@@ -975,12 +980,15 @@ public abstract class ContainerBase exte
 @Override
 public ContainerListener[] findContainerListeners() {
 
-synchronized (listeners) {
+Lock read = listenersLock.readLock();
+read.lock();
+try {
 ContainerListener[] results = 
 new ContainerListener[listeners.size()];
 return listeners.toArray(results);
+} finally {
+read.unlock();
 }
-
 }
 
 
@@ -1059,10 +1067,13 @@ public abstract class ContainerBase exte
 @Override
 public void removeContainerListener(ContainerListener listener) {
 
-synchronized (listeners) {
+Lock write = listenersLock.writeLock();
+write.lock();
+try {
 listeners.remove(listener);
+} finally {
+write.unlock();
 }
-
 }
 
 
@@ -1397,16 +1408,31 @@ public abstract class ContainerBase exte
 @Override
 public void fireContainerEvent(String type, Object data) {
 
-if (listeners.size()  1)
-return;
-ContainerEvent event = new ContainerEvent(this, type, data);
-ContainerListener list[] = new ContainerListener[0];
-synchronized (listeners) {
-list = listeners.toArray(list);
+/*
+ * Implementation note
+ * There are two options here.
+ * 1) Take a copy of listeners and fire the events outside of the read
+ *lock
+ * 2) Don't take a copy and fire the events inside the read lock
+ *
+ * Approach 2 has been used here since holding the read lock only
+ * prevents writes and that is preferable to creating lots of array
+ * objects. Since writes occur on start / stop (unless an external
+ * management tool is used) then holding the read lock for a relatively
+ * long time should not be an issue.
+ */
+Lock read = listenersLock.readLock();
+read.lock();
+try {
+if (listeners.size()  1)
+return;
+ContainerEvent event = new ContainerEvent(this, type, data);
+for (ContainerListener listener : listeners) {
+listener.containerEvent(event);
+}
+} finally {
+read.unlock();
 }
-for (int i = 0; i  list.length; i++)
-list[i].containerEvent(event);
-
 }
 
 

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=1349300r1=1349299r2=1349300view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 12 12:40:00 2012
@@ -65,6 +65,10 @@
 start-stop thread pool. It allows to use daemon threads and give
 them more distinct names. (kfujino)
   /update
+  fix
+bug52999/bug: Remove synchronization bottleneck from the firing of
+codeContainer/code events. (markt)  
+  

[Bug 52999] Performance issue with locking in ContainerBase.fireContainerEvent()

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52999

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
The OP may have meant context attributes rather than request attributes.

I'm tempted to remove those container events for performance reasons.

I'm in favour of the ReadWriteLock since there is less copying and therefore
fewer objects and hence less GC.

Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.

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



[Tomcat Wiki] Update of LocalBadContent by ChuckCaldarale

2012-06-12 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The LocalBadContent page has been changed by ChuckCaldarale:
http://wiki.apache.org/tomcat/LocalBadContent?action=diffrev1=51rev2=52

  mamaiacazare
  masterjin\.com
  mathsolutions\.50webs\.com
+ meratolreviewblog\.com
  mnsp\.cn
  muscleandfitness\.net
  myeurowatches\.com

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



Re: [VOTE] Release Apache Tomcat Native 1.1.24

2012-06-12 Thread Rainer Jung

On 11.06.2012 14:54, Mladen Turk wrote:

Version 1.1.24 is feature-add release containing additional
API to set per-socket timeouts inside Poller.
The proposed release artefacts can be found at [1],
and the build was done using tag [2].

The VOTE will remain open for at least 48 hours.

The Apache Tomcat Native 1.1.24 is
  [X] Stable, go ahead and release
  [ ] Broken because of ...


+1 to release

Detailed results (- indicates things which we could improve). Though 
the list is long, it is slightly shorter than when I checked last time 
(1.1.22). Overall I'm still +1 for stable, because I didn't find

regressions. But there is room for improvement.

+ Tested with Java 1.6.0_30 (but configured against Java 1.5),
  APR 1.4.6 and OpenSSL 1.0.1c
+ Platforms Solaris 8+10 Sparc, SLES 10, 32 and 64 Bits,
  SLES 11 64 Bits, RHEL 5+6 64 Bits
+ MD5 OK
+ signatures OK
+ key in KEYS file
- KEYS file is contained in the source distribution,
  I think it would be better to remove it there, because
  people should *not* check the key against one in the untrusted
  download. The file differs from the one in the download area
  (it is just a subset)
- name of ocsp binary changed from
  ...win32-ocsp... to ...ocsp-win32...
+ gz and zip for sources consistent
- Except for different permissions: zip seems to also contain group
  write permissions. Not a real problem, but it's a bit strange
  that perms differ between the archive.
+ source dist consistent with svn tag
- Except for the following pieces missing in the source dist:
  - jnirelease.sh
  - xdocs (but sources contain docs generated from xdocs)
  I suggets for the future we also include the script and the xdocs
  to make source dist more complete and self-contained.
- README.txt:
  - paths beginning with examples/ miss a leading jni/
  - ant comands are wrong (run-echo instead of echo-example
and probably run-ssl-server or run-local-server instead
of server-example.
- config-guess and config.sub could get an update this year
  ('2011-05-11' resp. '2011-03-23' instead of recent '2012-06-10'
   resp. '2012-04-18').
+ recreated release with jnirelease script, results are
  consistent with source dist, except for minor expected diffs in
  CHANGELOG.txt, build-outputs.mk and generated docs
  (whitespace and attribute ordering)
- Warnings during make on Solaris:

src/file.c: In function 'Java_org_apache_tomcat_jni_File_writev':
src/file.c:384: warning: pointer targets in assignment differ in signedness
src/file.c:390: warning: pointer targets in passing argument 3 of 
'(*e)-ReleaseByteArrayElements' differ in signedness

src/file.c: In function 'Java_org_apache_tomcat_jni_File_writevFull':
src/file.c:418: warning: pointer targets in assignment differ in signedness
src/file.c:428: warning: pointer targets in passing argument 3 of 
'(*e)-ReleaseByteArrayElements' differ in signedness


src/network.c: In function 'Java_org_apache_tomcat_jni_Socket_sendv':
src/network.c:668: warning: pointer targets in assignment differ in 
signedness
src/network.c:674: warning: pointer targets in passing argument 3 of 
'(*e)-ReleaseByteArrayElements' differ in signedness

src/network.c: In function 'Java_org_apache_tomcat_jni_Socket_sendfile':
src/network.c:1220: warning: pointer targets in assignment differ in 
signedness
src/network.c:1225: warning: pointer targets in assignment differ in 
signedness
src/network.c:1243: warning: pointer targets in passing argument 3 of 
'(*e)-ReleaseByteArrayElements' differ in signedness
src/network.c:1247: warning: pointer targets in passing argument 3 of 
'(*e)-ReleaseByteArrayElements' differ in signedness


src/poll.c:271: warning: 'remove_all' defined but not used

src/ssl.c: In function 'ssl_rand_make':
src/ssl.c:469: warning: value computed is not used

+ make succeeds and builds lib
+ all unit tests contained in TC trunk run successful with
  APR connector and this version of tcative

Concerning the Java classes in the source distribution:

- it is unclear to me, why they are still distributed.
  Aren't the official sources in trunk/java/org/apache/tomcat/jni?
  Note that they are not identical and the tcnative version of the
  classes is outdated and not maintained any more. So IMHO we should
  no longer distribute them. Either remove from the distribution,
  or distribute the TC 7 or trunk ones.
  If we remove them, what about the test and examples classes?
  I think they have no other home.
  Furthermore some of the old files do not exist inside TC:
  - Apr.java, apr.properties, jni/Buffer.java and jni/Thread.java
- ant part of build:
  - No mentioning of running ant download before tests. Without
it test compilation fails.
  - ant test fails in line 85 of SocketServerTestSuite.java, because
on my system the checking for precisely 2 milliseconds won't work.
The call returns after 11 millis not after 2
  - ant run-echo: will fail, because by default uses privileged
port 23. Maybe switch to 8023? Users should not run 

svn commit: r1349317 - /tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 13:23:53 2012
New Revision: 1349317

URL: http://svn.apache.org/viewvc?rev=1349317view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52954
Be tolerant of slightly broken Android implementation of DIGEST auth. Security 
is not impacted.

Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java

Modified: 
tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=1349317r1=1349316r2=1349317view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
Tue Jun 12 13:23:53 2012
@@ -566,7 +566,23 @@ public class DigestAuthenticator extends
 uriQuery = request.getRequestURI() + ? + query;
 }
 if (!uri.equals(uriQuery)) {
-return false;
+// Some clients (older Android) use an absolute URI for
+// DIGEST but a relative URI in the request line.
+// request. 2.3.5  fixed Android version = 4.0.3
+String host = request.getHeader(host);
+String scheme = request.getScheme();
+if (host != null  !uriQuery.startsWith(scheme)) {
+StringBuilder absolute = new StringBuilder();
+absolute.append(scheme);
+absolute.append(://);
+absolute.append(host);
+absolute.append(uriQuery);
+if (!uri.equals(absolute.toString())) {
+return false;
+}
+} else {
+return false;
+}
 }
 }
 
@@ -625,7 +641,9 @@ public class DigestAuthenticator extends
 if (cnonce == null || nc == null) {
 return false;
 }
-if (nc.length() != 8) {
+// RFC 2617 says nc must be 8 digits long. Older Android 
clients
+// use 6. 2.3.5  fixed Android version = 4.0.3
+if (nc.length()  6 || nc.length()  8) {
 return false;
 }
 long count;



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



svn commit: r1349321 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/authenticator/DigestAuthenticator.java webapps/docs/changelog.xml

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 13:26:10 2012
New Revision: 1349321

URL: http://svn.apache.org/viewvc?rev=1349321view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52954
Be tolerant of slightly broken Android implementation of DIGEST auth. Security 
is not impacted.

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

tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=1349321r1=1349320r2=1349321view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
 Tue Jun 12 13:26:10 2012
@@ -580,7 +580,23 @@ public class DigestAuthenticator extends
 uriQuery = request.getRequestURI() + ? + query;
 }
 if (!uri.equals(uriQuery)) {
-return false;
+// Some clients (older Android) use an absolute URI for
+// DIGEST but a relative URI in the request line.
+// request. 2.3.5  fixed Android version = 4.0.3
+String host = request.getHeader(host);
+String scheme = request.getScheme();
+if (host != null  !uriQuery.startsWith(scheme)) {
+StringBuilder absolute = new StringBuilder();
+absolute.append(scheme);
+absolute.append(://);
+absolute.append(host);
+absolute.append(uriQuery);
+if (!uri.equals(absolute.toString())) {
+return false;
+}
+} else {
+return false;
+}
 }
 }
 
@@ -642,7 +658,9 @@ public class DigestAuthenticator extends
 if (cnonce == null || nc == null) {
 return false;
 }
-if (nc.length() != 8) {
+// RFC 2617 says nc must be 8 digits long. Older Android 
clients
+// use 6. 2.3.5  fixed Android version = 4.0.3
+if (nc.length()  6 || nc.length()  8) {
 return false;
 }
 long count;

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=1349321r1=1349320r2=1349321view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 12 13:26:10 2012
@@ -60,6 +60,11 @@
 bug52055/bug: An additional fix to ensure that the
 ChunkedInputFilter is correctly recycled. (markt)
   /fix
+  add
+bug52954/bug: Make DIGEST authentication tolerant of clients 
(mainly
+older Android implementations) that do not follow RFC 2617 exactly.
+(markt) 
+  /add
   update
 bug52955/bug: Implement custom thread factory for container
 start-stop thread pool. It allows to use daemon threads and give



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



[Bug 52954] Allowing for broken android HTTP DIGEST support

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52954

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

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

--- Comment #2 from Mark Thomas ma...@apache.org ---
Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.

For the record Android = 2.3.5 is broken, = 4.0.3 is fixed. I didn't dig
though the source to find out exactly where this was 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



[Tomcat Wiki] Update of LocalBadContent by KonstantinKolinko

2012-06-12 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The LocalBadContent page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/LocalBadContent?action=diffrev1=52rev2=53

  angosso
  angosso\.com
  angosso\.net
+ \.ask\.com
  backlinklist\.org
  bettingpro\.com
  bit\.ly

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



[Bug 48600] Performance issue with tags

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48600

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Mark Thomas ma...@apache.org ---
Caching has been added in the 7.0.x series but will not be back-ported to
6.0.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: [VOTE] Release Apache Tomcat Native 1.1.24

2012-06-12 Thread Mladen Turk

On 06/12/2012 03:19 PM, Rainer Jung wrote:


I implemented those for Solaris long ago and thought they existed for
Linux from the beginning. But in fact for Linux there are only memory


Thanks for such a thorough review!
Could you add some of your thoughts into trunk's README

Just add
TODO

...

at the bottom of that file.




Cheets
--
^TM



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



Re: [VOTE] Release Apache Tomcat Native 1.1.24

2012-06-12 Thread Mladen Turk

On 06/11/2012 02:54 PM, Mladen Turk wrote:


The VOTE will remain open for at least 48 hours.

The Apache Tomcat Native 1.1.24 is
  [X] Stable, go ahead and release
  [ ] Broken because of ...



Cast my vote.


Regards
--
^TM



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



[Bug 53403] New: Reference to 2.2/2.3 servlet container in Tomcat 7 docs

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53403

  Priority: P2
Bug ID: 53403
  Assignee: dev@tomcat.apache.org
   Summary: Reference to 2.2/2.3 servlet container in Tomcat 7
docs
  Severity: trivial
Classification: Unclassified
OS: Windows Vista
  Reporter: anthonygerrard+apache@gmail.com
  Hardware: PC
Status: NEW
   Version: unspecified
 Component: Documentation
   Product: Tomcat 7

http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html

When you install an application into Tomcat (or any other 2.2/2.3-compatible
server)

shoud read something like

When you install an application into Tomcat (or any other
2.2/2.3/3.0-compatible server)

-- 
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: r1349410 - /tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 16:02:44 2012
New Revision: 1349410

URL: http://svn.apache.org/viewvc?rev=1349410view=rev
Log:
Review of r1349300:
Make ReadWriteLock fields final (the new one and an old private one as well).

Modified:
tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1349410r1=1349409r2=1349410view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Tue Jun 12 
16:02:44 2012
@@ -182,7 +182,7 @@ public abstract class ContainerBase exte
  */
 protected ArrayListContainerListener listeners =
 new ArrayListContainerListener();
-protected ReadWriteLock listenersLock = new ReentrantReadWriteLock();
+protected final ReadWriteLock listenersLock = new ReentrantReadWriteLock();
 
 
 /**
@@ -248,7 +248,7 @@ public abstract class ContainerBase exte
 /**
  * Lock used to control access to the Realm.
  */
-private ReadWriteLock realmLock = new ReentrantReadWriteLock();
+private final ReadWriteLock realmLock = new ReentrantReadWriteLock();
 
 /**
  * The resources DirContext object with which this Container is associated.



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



svn commit: r1349425 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ContainerBase.java

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 16:31:31 2012
New Revision: 1349425

URL: http://svn.apache.org/viewvc?rev=1349425view=rev
Log:
Merged revision 1349410 from tomcat/trunk:
Review of r1349300:
Make ReadWriteLock fields final (the new one and an old private one as well).

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1349425r1=1349424r2=1349425view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java Tue 
Jun 12 16:31:31 2012
@@ -180,7 +180,7 @@ public abstract class ContainerBase exte
  */
 protected ArrayListContainerListener listeners =
 new ArrayListContainerListener();
-protected ReadWriteLock listenersLock = new ReentrantReadWriteLock();
+protected final ReadWriteLock listenersLock = new ReentrantReadWriteLock();
 
 
 /**
@@ -246,7 +246,7 @@ public abstract class ContainerBase exte
 /**
  * Lock used to control access to the Realm.
  */
-private ReadWriteLock realmLock = new ReentrantReadWriteLock();
+private final ReadWriteLock realmLock = new ReentrantReadWriteLock();
 
 /**
  * The resources DirContext object with which this Container is associated.



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



Re: [VOTE] Release Apache Tomcat Native 1.1.24

2012-06-12 Thread Rainer Jung

On 12.06.2012 17:39, Mladen Turk wrote:

On 06/12/2012 03:19 PM, Rainer Jung wrote:


I implemented those for Solaris long ago and thought they existed for
Linux from the beginning. But in fact for Linux there are only memory


Thanks for such a thorough review!


Happy to not get flamed :)


Could you add some of your thoughts into trunk's README


Will do.


Just add
TODO

...

at the bottom of that file.


Regards,

Rainer


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



Time for 7.0.28?

2012-06-12 Thread Filip Hanik (mailing lists)
Over 2 months since last release

Got some critical fixes that I would like to see released
 - max connections broken
 - send file in nio broken
 - jdbc pool can hang during DB failure

Filip


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



Re: Time for 7.0.28?

2012-06-12 Thread Mladen Turk

On 06/12/2012 06:53 PM, Filip Hanik (mailing lists) wrote:

Over 2 months since last release

Got some critical fixes that I would like to see released
  - max connections broken
  - send file in nio broken
  - jdbc pool can hang during DB failure



Sure, we need native 1.1.24 for Mark's WebSockets support.
Think Mark has that on the schedule immediately after native release.


Regards
--
^TM



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



svn commit: r1349439 - in /tomcat/trunk/java/org/apache/catalina: core/StandardContext.java session/StandardSession.java

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 16:58:38 2012
New Revision: 1349439

URL: http://svn.apache.org/viewvc?rev=1349439view=rev
Log:
Review of Context.getApplicationLifecycleListeners() calls:
Do less work if there are no listeners or 'notify' flag is false.
I do not expect much effect from this change, because implementation of 
Context.getApplicationLifecycleListeners() in StandardContext is lightweight: 
it returns a field value. Note that by default it returns an empty array, not 
null.

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/trunk/java/org/apache/catalina/session/StandardSession.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1349439r1=1349438r2=1349439view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue Jun 12 
16:58:38 2012
@@ -4658,7 +4658,7 @@ public class StandardContext extends Con
 context.setNewServletContextListenerAllowed(false);
 
 Object instances[] = getApplicationLifecycleListeners();
-if (instances == null)
+if (instances == null || instances.length == 0)
 return (ok);
 ServletContextEvent event =
   new ServletContextEvent(getServletContext());
@@ -4699,7 +4699,7 @@ public class StandardContext extends Con
 
 boolean ok = true;
 Object listeners[] = getApplicationLifecycleListeners();
-if (listeners != null) {
+if (listeners != null  listeners.length  0) {
 ServletContextEvent event =
 new ServletContextEvent(getServletContext());
 for (int i = 0; i  listeners.length; i++) {

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=1349439r1=1349438r2=1349439view=diff
==
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Tue Jun 
12 16:58:38 2012
@@ -402,7 +402,7 @@ public class StandardSession implements 
 // Notify interested application event listeners
 Context context = (Context) manager.getContainer();
 Object listeners[] = context.getApplicationLifecycleListeners();
-if (listeners != null) {
+if (listeners != null  listeners.length  0) {
 HttpSessionEvent event =
 new HttpSessionEvent(getSession());
 for (int i = 0; i  listeners.length; i++) {
@@ -770,32 +770,34 @@ public class StandardSession implements 
 }
 }
 try {
-Object listeners[] = 
context.getApplicationLifecycleListeners();
-if (notify  (listeners != null)) {
-HttpSessionEvent event =
-new HttpSessionEvent(getSession());
-for (int i = 0; i  listeners.length; i++) {
-int j = (listeners.length - 1) - i;
-if (!(listeners[j] instanceof HttpSessionListener))
-continue;
-HttpSessionListener listener =
-(HttpSessionListener) listeners[j];
-try {
-
context.fireContainerEvent(beforeSessionDestroyed,
-listener);
-listener.sessionDestroyed(event);
-context.fireContainerEvent(afterSessionDestroyed,
-listener);
-} catch (Throwable t) {
-ExceptionUtils.handleThrowable(t);
+if (notify) {
+Object listeners[] = 
context.getApplicationLifecycleListeners();
+if (listeners != null  listeners.length  0) {
+HttpSessionEvent event =
+new HttpSessionEvent(getSession());
+for (int i = 0; i  listeners.length; i++) {
+int j = (listeners.length - 1) - i;
+if (!(listeners[j] instanceof HttpSessionListener))
+continue;
+HttpSessionListener listener =
+(HttpSessionListener) listeners[j];
 try {
-context.fireContainerEvent(
-afterSessionDestroyed, listener);
-} catch (Exception e) {
-

RE: [VOTE] Release Apache Tomcat Native 1.1.24

2012-06-12 Thread Filip Hanik (mailing lists)
  [X] Stable, go ahead and release


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



Re: Time for 7.0.28?

2012-06-12 Thread markt
Mladen Turk mt...@apache.org wrote:

On 06/12/2012 06:53 PM, Filip Hanik (mailing lists) wrote:
 Over 2 months since last release

 Got some critical fixes that I would like to see released
   - max connections broken
   - send file in nio broken
   - jdbc pool can hang during DB failure


Sure, we need native 1.1.24 for Mark's WebSockets support.
Think Mark has that on the schedule immediately after native release.


Regards
-- 
^TM



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

Yep, as per the previous messages to the dev list re the 7.0.28 release.

Mark

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



svn commit: r1349473 - in /tomcat/trunk/webapps/examples/WEB-INF: ./ classes/compressionFilters/

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 18:57:00 2012
New Revision: 1349473

URL: http://svn.apache.org/viewvc?rev=1349473view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50182
Various improvements to the compression filter example.
Patch by David Becker

Modified:

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
tomcat/trunk/webapps/examples/WEB-INF/web.xml

Modified: 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1349473r1=1349472r2=1349473view=diff
==
--- 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 (original)
+++ 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 Tue Jun 12 18:57:00 2012
@@ -14,11 +14,11 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-
 package compressionFilters;
 
 import java.io.IOException;
 import java.util.Enumeration;
+import java.util.StringTokenizer;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
@@ -29,17 +29,14 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-
 /**
  * Implementation of codejavax.servlet.Filter/code used to compress
  * the ServletResponse if it is bigger than a threshold.
  *
  * @author Amy Roh
  * @author Dmitri Valdin
- * @version $Id$
  */
-
-public class CompressionFilter implements Filter{
+public class CompressionFilter implements Filter {
 
 /**
  * The filter configuration object we are associated with.  If this value
@@ -48,18 +45,32 @@ public class CompressionFilter implement
 private FilterConfig config = null;
 
 /**
- * Minimal reasonable threshold
+ * Minimal reasonable threshold.
  */
 private int minThreshold = 128;
 
+/**
+ * The threshold number to compress.
+ */
+protected int compressionThreshold = 0;
+
+/**
+ * Minimal reasonable buffer.
+ */
+private int minBuffer = 8192;  // 8KB is what tomcat would use by default 
anyway
+
+/**
+ * The compression buffer size to avoid chunking.
+ */
+protected int compressionBuffer = 0;
 
 /**
- * The threshold number to compress
+ * The mime types to compress.
  */
-protected int compressionThreshold;
+protected String[] compressionMimeTypes = {text/html, text/xml, 
text/plain};
 
 /**
- * Debug level for this filter
+ * Debug level for this filter.
  */
 private int debug = 0;
 
@@ -68,7 +79,6 @@ public class CompressionFilter implement
  *
  * @param filterConfig The filter configuration object
  */
-
 @Override
 public void init(FilterConfig filterConfig) {
 
@@ -77,9 +87,8 @@ public class CompressionFilter implement
 String value = filterConfig.getInitParameter(debug);
 if (value!=null) {
 debug = Integer.parseInt(value);
-} else {
-debug = 0;
 }
+
 String str = filterConfig.getInitParameter(compressionThreshold);
 if (str!=null) {
 compressionThreshold = Integer.parseInt(str);
@@ -90,12 +99,33 @@ public class CompressionFilter implement
 }
 compressionThreshold = minThreshold;
 }
-} else {
-compressionThreshold = 0;
 }
 
-} else {
-compressionThreshold = 0;
+str = filterConfig.getInitParameter(compressionBuffer);
+if (str!=null) {
+compressionBuffer = Integer.parseInt(str);
+if (compressionBuffer  minBuffer) {
+if (debug  0) {
+System.out.println(compressionBuffer should be =  + 
minBuffer);
+System.out.println(compressionBuffer set to  + 
minBuffer);
+}
+compressionBuffer = minBuffer;
+}
+}
+
+str = filterConfig.getInitParameter(compressionMimeTypes);
+if (str!=null) {
+compressionMimeTypes = null;
+StringTokenizer st = new StringTokenizer(str, ,);
+
+while (st.hasMoreTokens()) {
+compressionMimeTypes = 
addStringArray(compressionMimeTypes, st.nextToken().trim());
+

svn commit: r1349475 - /tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 19:05:32 2012
New Revision: 1349475

URL: http://svn.apache.org/viewvc?rev=1349475view=rev
Log:
Drop info

Modified:

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java

Modified: 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java?rev=1349475r1=1349474r2=1349475view=diff
==
--- 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
 (original)
+++ 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
 Tue Jun 12 19:05:32 2012
@@ -59,11 +59,6 @@ public class CompressionServletResponseW
 protected HttpServletResponse origResponse = null;
 
 /**
- * Descriptive information about this Response implementation.
- */
-protected static final String info = GZipServletResponseWrapper;
-
-/**
  * The ServletOutputStream that has been returned by
  * codegetOutputStream()/code, if any.
  */



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



svn commit: r1349477 - in /tomcat/tc7.0.x/trunk: ./ webapps/docs/ webapps/examples/WEB-INF/ webapps/examples/WEB-INF/classes/compressionFilters/

2012-06-12 Thread markt
Author: markt
Date: Tue Jun 12 19:07:39 2012
New Revision: 1349477

URL: http://svn.apache.org/viewvc?rev=1349477view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50182
Various improvements to the compression filter example.
Patch by David Becker

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

tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java

tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java

tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml

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

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=1349477r1=1349476r2=1349477view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 12 19:07:39 2012
@@ -344,6 +344,10 @@
 Remove obsolete bug warning from Windows service
 documentation page. (rjung)
   /fix
+  add
+bug50182/bug: Various improvements to the Compression Filter. Patch
+provided by David Becker. (markt)
+  /add
   fix
 bug52853/bug: Clarify how Jar Scanner handles directories. (markt)
   /fix

Modified: 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1349477r1=1349476r2=1349477view=diff
==
--- 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 Tue Jun 12 19:07:39 2012
@@ -14,11 +14,11 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-
 package compressionFilters;
 
 import java.io.IOException;
 import java.util.Enumeration;
+import java.util.StringTokenizer;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
@@ -29,17 +29,14 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-
 /**
  * Implementation of codejavax.servlet.Filter/code used to compress
  * the ServletResponse if it is bigger than a threshold.
  *
  * @author Amy Roh
  * @author Dmitri Valdin
- * @version $Id$
  */
-
-public class CompressionFilter implements Filter{
+public class CompressionFilter implements Filter {
 
 /**
  * The filter configuration object we are associated with.  If this value
@@ -48,18 +45,32 @@ public class CompressionFilter implement
 private FilterConfig config = null;
 
 /**
- * Minimal reasonable threshold
+ * Minimal reasonable threshold.
  */
 private int minThreshold = 128;
 
+/**
+ * The threshold number to compress.
+ */
+protected int compressionThreshold = 0;
+
+/**
+ * Minimal reasonable buffer.
+ */
+private int minBuffer = 8192;  // 8KB is what tomcat would use by default 
anyway
+
+/**
+ * The compression buffer size to avoid chunking.
+ */
+protected int compressionBuffer = 0;
 
 /**
- * The threshold number to compress
+ * The mime types to compress.
  */
-protected int compressionThreshold;
+protected String[] compressionMimeTypes = {text/html, text/xml, 
text/plain};
 
 /**
- * Debug level for this filter
+ * Debug level for this filter.
  */
 private int debug = 0;
 
@@ -68,7 +79,6 @@ public class CompressionFilter implement
  *
  * @param filterConfig The filter configuration object
  */
-
 @Override
 public void init(FilterConfig filterConfig) {
 
@@ -77,9 +87,8 @@ public class CompressionFilter implement
 String value = filterConfig.getInitParameter(debug);
 if (value!=null) {
 debug = Integer.parseInt(value);
-} else {
-debug = 0;
 }
+
 String str = filterConfig.getInitParameter(compressionThreshold);
 if (str!=null) {
 compressionThreshold = Integer.parseInt(str);
@@ -90,12 +99,33 @@ public class CompressionFilter implement
 }
 compressionThreshold = 

[Bug 50182] Contributing back enhancements to CompressionFilter

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50182

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

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

--- Comment #2 from Mark Thomas ma...@apache.org ---
Patch applied (with minor alterations) to 7.0.x and will be included in 7.0.28
onwards.

-- 
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: svn commit: r1349473 - in /tomcat/trunk/webapps/examples/WEB-INF: ./ classes/compressionFilters/

2012-06-12 Thread Konstantin Kolinko
2012/6/12  ma...@apache.org:
 Author: markt
 Date: Tue Jun 12 18:57:00 2012
 New Revision: 1349473

 URL: http://svn.apache.org/viewvc?rev=1349473view=rev
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50182
 Various improvements to the compression filter example.
 Patch by David Becker

 Modified:
    
 tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
    
 tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
    
 tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java
    
 tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
    tomcat/trunk/webapps/examples/WEB-INF/web.xml


In CompressionFilter.java  the new method addStringArray(..) is an odd
one. It is not needed there. When processing
filterConfig.getInitParameter(compressionMimeTypes); just put values
in a list (ignoring empty ones?) and call toArray().

Best regards,
Konstantin Kolinko

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



[Bug 53071] ErrorReportValve ignores message from throwable

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53071

--- Comment #6 from Konstantin Kolinko knst.koli...@gmail.com ---
Created attachment 28920
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=28920action=edit
Screen shot from Tomcat 7.0.27

Just a screen shot, for comparison. It is before implementing this feature.
It is CookieExample page, when pressing submit button without entering any
values.

-- 
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 53071] ErrorReportValve ignores message from throwable

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53071

--- Comment #7 from Konstantin Kolinko knst.koli...@gmail.com ---
Created attachment 28921
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=28921action=edit
Screen shot from Tomcat trunk

The same with Tomcat trunk after implementing the feature.

-- 
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 53071] ErrorReportValve ignores message from throwable

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53071

--- Comment #8 from Konstantin Kolinko knst.koli...@gmail.com ---
(In reply to comment #4)
 Putting this caveat in the bug and not just on the dev list:

I agree with Mark here.
The change in r1348762 is in the place where ErrorReportValve prepares HTML
text of the page. It does not affect other components. It does not affect
components that display their own error pages.  The old implementation already
displays the exception, so nothing new is revealed.


I personally do not like use of {0} in the messages for the description
field. Especially the ones for 404 and 403. It looks like some unrelated text
is inserted into the middle of a sentence. With this change it is printed 4
times on the same page.

-- 
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 53071] ErrorReportValve ignores message from throwable

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53071

--- Comment #9 from Michael Osipov 1983-01...@gmx.net ---
(In reply to comment #8)
 (In reply to comment #4)
  Putting this caveat in the bug and not just on the dev list:
 
 I agree with Mark here.
 The change in r1348762 is in the place where ErrorReportValve prepares HTML
 text of the page. It does not affect other components. It does not affect
 components that display their own error pages.  The old implementation
 already displays the exception, so nothing new is revealed.

Exactly, the same information but more prominent.

 I personally do not like use of {0} in the messages for the description
 field. Especially the ones for 404 and 403. It looks like some unrelated
 text is inserted into the middle of a sentence. With this change it is
 printed 4 times on the same page.

I personally dislike that one too in this valve.

In my opinion, the following should happen:

If message is not given: Message should be from
https://tools.ietf.org/html/rfc2616#section-6.1.1 as per status code short name
and description should be a copy of the first sentence of the RFC description.
Maybe just as HTTPd does.
If message is given: Display message and show RFC description too.

Stack trace should be left as is.

It might make sense to limit the message length in the first line to n chars
and show the entire message in the message line. But if and only if the message
is to0 long. Otherwise the message line should be omitted.

-- 
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: r687 - /release/tomcat/tomcat-connectors/jk/README.html

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 20:57:06 2012
New Revision: 687

Log:
Align with r1348979 and set svn:eol-style=native
Make verification text consistent across all components

Modified:
release/tomcat/tomcat-connectors/jk/README.html   (contents, props changed)

Modified: release/tomcat/tomcat-connectors/jk/README.html
==
--- release/tomcat/tomcat-connectors/jk/README.html (original)
+++ release/tomcat/tomcat-connectors/jk/README.html Tue Jun 12 20:57:06 2012
@@ -34,35 +34,12 @@
 /p
 
 h2a name=sigPGP Signatures/a/h2
-pAll of the release distribution packages have been digitally signed
-   (using PGP or GPG) by the Apache Tomcat Group members that constructed them.
-   There will be an accompanying SAMPEMdistribution/EM.asc/SAMP file
-   in the same directory as the distribution.  The PGP keys can be found
-   at the MIT key repository and within this project's
-   a href=http://www.apache.org/dist/tomcat/tomcat-connectors/KEYS;KEYS 
file/a.
-/p
-
-pAlways use the signature files to verify the authenticity
-   of the distribution, ie.g./i,/p
-
-pre
-% pgpk -a KEYS
-% pgpv tomcat-connectors-1.2.37-src.tar.gz.asc
-ior/i,
-% pgp -ka KEYS
-% pgp tomcat-connectors-1.2.37-src.tar.gz.asc
-ior/i,
-% gpg --import KEYS
-% gpg --verify tomcat-connectors-1.2.37-src.tar.gz.asc
-/pre
-
-pWe offer MD5 and SHA1 hashes as an alternative to validate the integrity
-   of the downloaded files. A unix program called codemd5/code or
-   codemd5sum/code is included in many unix distributions.  It is
-   also available as part of a
-   href=http://www.gnu.org/software/textutils/textutils.html;GNU
-   Textutils/a.  Windows users can get binary md5 programs from a
-   href=http://www.fourmilab.ch/md5/;here/a, a
-   href=http://www.pc-tools.net/win32/freeware/console/;here/a, or
-   a href=http://www.slavasoft.com/fsum/;here/a.
-/p
+pYou strongmust/strong verify the integrity of the downloaded files.
+   We provide OpenPGP signatures for every release file.  This signature should
+   be matched against the
+   a href=http://www.apache.org/dist/tomcat/tomcat-connectors/KEYS;KEYS/a
+   file which contains the OpenPGP keys of the Release Managers. We also
+   provide an codeMD5/code checksum for every release file. After you
+   download the file, you should calculate a checksum for your download, and
+   make sure it is the same as ours.
+/p
\ No newline at end of file

Propchange: release/tomcat/tomcat-connectors/jk/README.html
--
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: r687 - /release/tomcat/tomcat-connectors/jk/README.html

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 20:57:06 2012
New Revision: 687

Log:
Align with r1348979 and set svn:eol-style=native
Make verification text consistent across all components

Modified:
release/tomcat/tomcat-connectors/jk/README.html   (contents, props changed)

Modified: release/tomcat/tomcat-connectors/jk/README.html
==
--- release/tomcat/tomcat-connectors/jk/README.html (original)
+++ release/tomcat/tomcat-connectors/jk/README.html Tue Jun 12 20:57:06 2012
@@ -34,35 +34,12 @@
 /p
 
 h2a name=sigPGP Signatures/a/h2
-pAll of the release distribution packages have been digitally signed
-   (using PGP or GPG) by the Apache Tomcat Group members that constructed them.
-   There will be an accompanying SAMPEMdistribution/EM.asc/SAMP file
-   in the same directory as the distribution.  The PGP keys can be found
-   at the MIT key repository and within this project's
-   a href=http://www.apache.org/dist/tomcat/tomcat-connectors/KEYS;KEYS 
file/a.
-/p
-
-pAlways use the signature files to verify the authenticity
-   of the distribution, ie.g./i,/p
-
-pre
-% pgpk -a KEYS
-% pgpv tomcat-connectors-1.2.37-src.tar.gz.asc
-ior/i,
-% pgp -ka KEYS
-% pgp tomcat-connectors-1.2.37-src.tar.gz.asc
-ior/i,
-% gpg --import KEYS
-% gpg --verify tomcat-connectors-1.2.37-src.tar.gz.asc
-/pre
-
-pWe offer MD5 and SHA1 hashes as an alternative to validate the integrity
-   of the downloaded files. A unix program called codemd5/code or
-   codemd5sum/code is included in many unix distributions.  It is
-   also available as part of a
-   href=http://www.gnu.org/software/textutils/textutils.html;GNU
-   Textutils/a.  Windows users can get binary md5 programs from a
-   href=http://www.fourmilab.ch/md5/;here/a, a
-   href=http://www.pc-tools.net/win32/freeware/console/;here/a, or
-   a href=http://www.slavasoft.com/fsum/;here/a.
-/p
+pYou strongmust/strong verify the integrity of the downloaded files.
+   We provide OpenPGP signatures for every release file.  This signature should
+   be matched against the
+   a href=http://www.apache.org/dist/tomcat/tomcat-connectors/KEYS;KEYS/a
+   file which contains the OpenPGP keys of the Release Managers. We also
+   provide an codeMD5/code checksum for every release file. After you
+   download the file, you should calculate a checksum for your download, and
+   make sure it is the same as ours.
+/p
\ No newline at end of file

Propchange: release/tomcat/tomcat-connectors/jk/README.html
--
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: r1349528 - /tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml

2012-06-12 Thread olamy
Author: olamy
Date: Tue Jun 12 21:10:46 2012
New Revision: 1349528

URL: http://svn.apache.org/viewvc?rev=1349528view=rev
Log:
upgrade maven compiler plugin to 2.5.1 (more performant) in the archetype

Modified:

tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml

Modified: 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml?rev=1349528r1=1349527r2=1349528view=diff
==
--- 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml
 (original)
+++ 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/pom.xml
 Tue Jun 12 21:10:46 2012
@@ -37,7 +37,7 @@
 plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-compiler-plugin/artifactId
-  version2.3.2/version
+  version2.5.1/version
   configuration
 source1.5/source
 target1.5/target



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



svn commit: r1349529 - /tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml

2012-06-12 Thread olamy
Author: olamy
Date: Tue Jun 12 21:10:59 2012
New Revision: 1349529

URL: http://svn.apache.org/viewvc?rev=1349529view=rev
Log:
last selenium version in the archetype

Modified:

tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml

Modified: 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml?rev=1349529r1=1349528r2=1349529view=diff
==
--- 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml
 (original)
+++ 
tomcat/maven-plugin/trunk/tomcat-maven-archetype/src/main/resources/archetype-resources/basic-webapp-it/pom.xml
 Tue Jun 12 21:10:59 2012
@@ -31,7 +31,7 @@
 
   properties
 seleniumPluginVersion2.3/seleniumPluginVersion
-selenium-server.version2.21.0/selenium-server.version
+selenium-server.version2.23.1/selenium-server.version
 selenium.port/selenium.port
 tomcat.port9898/tomcat.port
 serverUrlhttp://localhost:${tomcat.port}//serverUrl



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



svn commit: r1349539 - /tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 21:19:50 2012
New Revision: 1349539

URL: http://svn.apache.org/viewvc?rev=1349539view=rev
Log:
For https://issues.apache.org/bugzilla/show_bug.cgi?id=50182
Review of r1349477:
use more simple code when converting a list of mime types into array and ignore 
empty strings.

Modified:

tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

Modified: 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1349539r1=1349538r2=1349539view=diff
==
--- 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 (original)
+++ 
tomcat/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 Tue Jun 12 21:19:50 2012
@@ -17,7 +17,9 @@
 package compressionFilters;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.StringTokenizer;
 
 import javax.servlet.Filter;
@@ -115,11 +117,21 @@ public class CompressionFilter implement
 
 str = filterConfig.getInitParameter(compressionMimeTypes);
 if (str!=null) {
-compressionMimeTypes = null;
+ListString values = new ArrayListString();
 StringTokenizer st = new StringTokenizer(str, ,);
 
 while (st.hasMoreTokens()) {
-compressionMimeTypes = 
addStringArray(compressionMimeTypes, st.nextToken().trim());
+String token = st.nextToken().trim();
+if (token.length()  0) {
+values.add(token);
+}
+}
+
+if (values.size()  0) {
+compressionMimeTypes = values.toArray(
+new String[values.size()]);
+} else {
+compressionMimeTypes = null;
 }
 
 if (debug  0) {
@@ -250,26 +262,5 @@ public class CompressionFilter implement
 return config;
 }
 
-/**
- * General use method
- *
- * @param sArray the StringArray
- * @param value string
- */
-private String[] addStringArray(String sArray[], String value) {
-String[] result = null;
-if (sArray == null) {
-result = new String[1];
-result[0] = value;
-}
-else {
-result = new String[sArray.length + 1];
-for (int i = 0; i  sArray.length; i++)
-result[i] = sArray[i];
-result[sArray.length] = value;
-}
-return result;
-}
-
 }
 



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



svn commit: r1349574 - in /tomcat/tc7.0.x/trunk: ./ webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

2012-06-12 Thread kkolinko
Author: kkolinko
Date: Tue Jun 12 22:41:39 2012
New Revision: 1349574

URL: http://svn.apache.org/viewvc?rev=1349574view=rev
Log:
Merged revision 1349539 from tomcat/trunk:
For https://issues.apache.org/bugzilla/show_bug.cgi?id=50182
Review of r1349477:
use more simple code when converting a list of mime types into array and ignore 
empty strings.

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

tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java

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

Modified: 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1349574r1=1349573r2=1349574view=diff
==
--- 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
 Tue Jun 12 22:41:39 2012
@@ -17,7 +17,9 @@
 package compressionFilters;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.StringTokenizer;
 
 import javax.servlet.Filter;
@@ -115,11 +117,21 @@ public class CompressionFilter implement
 
 str = filterConfig.getInitParameter(compressionMimeTypes);
 if (str!=null) {
-compressionMimeTypes = null;
+ListString values = new ArrayListString();
 StringTokenizer st = new StringTokenizer(str, ,);
 
 while (st.hasMoreTokens()) {
-compressionMimeTypes = 
addStringArray(compressionMimeTypes, st.nextToken().trim());
+String token = st.nextToken().trim();
+if (token.length()  0) {
+values.add(token);
+}
+}
+
+if (values.size()  0) {
+compressionMimeTypes = values.toArray(
+new String[values.size()]);
+} else {
+compressionMimeTypes = null;
 }
 
 if (debug  0) {
@@ -250,26 +262,5 @@ public class CompressionFilter implement
 return config;
 }
 
-/**
- * General use method
- *
- * @param sArray the StringArray
- * @param value string
- */
-private String[] addStringArray(String sArray[], String value) {
-String[] result = null;
-if (sArray == null) {
-result = new String[1];
-result[0] = value;
-}
-else {
-result = new String[sArray.length + 1];
-for (int i = 0; i  sArray.length; i++)
-result[i] = sArray[i];
-result[sArray.length] = value;
-}
-return result;
-}
-
 }
 



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



Could anybody give me some reference about how Tomcat handle the default servlet

2012-06-12 Thread Zhi Xie
If I deploy a war with a web.xml like this.

?xml version=1.0 encoding=UTF-8?
web-app id=WebApp_ID version=2.4
  xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=
http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  display-nameTest WAR/display-name

  !-- Example mapping using the default servlet --
  servlet-mapping
servlet-namedefault/servlet-name
url-pattern/images/*/url-pattern
  /servlet-mapping
/web-app

I want to know Tomcat how to handle it.
1. How to find DefaultServlet to handle this map.
2. If I define my own default servlet, how tomcat assure the DefaultServlet
don't override my own servlet.

I have debugged it in Tomcat 6.0.35. But I couldn't find the answer.

Could anybody give me some reference. Thank you very much.

Best Regards
Gary


WARNING: Incorrect connection count when running testsuite for APR/native 1.1.24

2012-06-12 Thread Konstantin Kolinko
Hi!

I run the testsuite for Tomcat trunk with APR connector with release
candidate for Tomcat Native 1.1.24, on WinXP 32-bit.

The testsuite passes successfully, but looking closer into log files I
see many occurrences of the following warning:

12.06.2012 21:13:43 org.apache.tomcat.util.net.AbstractEndpoint
countDownConnection
WARNING: Incorrect connection count, multiple socket.close called on
the same socket.

There are ~50 tests when it fails, the first one being
org.apache.catalina.authenticator.TestFormAuthenticator

It sounds like there are cases when BZ 53173 (connection counting and
maxConnections) is not fixed yet for APR connector.

Best regards,
Konstantin Kolinko

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



[Bug 53406] New: Stack overflow in connector

2012-06-12 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53406

  Priority: P2
Bug ID: 53406
  Assignee: dev@tomcat.apache.org
   Summary: Stack overflow in connector
  Severity: normal
Classification: Unclassified
  Reporter: fha...@apache.org
  Hardware: PC
Status: NEW
   Version: 7.0.27
 Component: Connectors
   Product: Tomcat 7

found against trunk on Jun 18, 2012

SEVERE:
java.lang.StackOverflowError
at
org.apache.catalina.core.StandardContextValve.event(StandardContextValve.java:128)
at org.apache.catalina.valves.ValveBase.event(ValveBase.java:204)
at
org.apache.catalina.core.StandardHostValve.event(StandardHostValve.java:223)
at org.apache.catalina.valves.ValveBase.event(ValveBase.java:204)
at org.apache.catalina.valves.ValveBase.event(ValveBase.java:204)
at
org.apache.catalina.core.StandardEngineValve.event(StandardEngineValve.java:110)
at
org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:209)
at
org.apache.coyote.http11.Http11NioProcessor.event(Http11NioProcessor.java:124)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:569)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:1008)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:999)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:277)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:596)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:1008)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:999)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:277)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:596)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:1008)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:999)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:277)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:596)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:1008)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:999)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:277)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:596)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:1008)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:999)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:277)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:596)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:730)
at