[Tomcat Wiki] Update of "AdminGroup" by KonstantinKolinko

2011-06-22 Thread Apache Wiki
Dear Wiki user,

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

The "AdminGroup" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/AdminGroup?action=diff&rev1=2&rev2=3

   * KonstantinKolinko
   * markt
   * SebastianBazley
+  * IanDarwin
  

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



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

2011-06-22 Thread jfclere
Author: jfclere
Date: Wed Jun 22 10:10:03 2011
New Revision: 1138377

URL: http://svn.apache.org/viewvc?rev=1138377&view=rev
Log:
Fix for JBWEB-196

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=1138377&r1=1138376&r2=1138377&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun 22 10:10:03 2011
@@ -155,3 +155,9 @@ PATCHES PROPOSED TO BACKPORT:
   Based on a patch by Dave Engberg
   +1: markt
   -1:
+
+* Fix truncated cookies.
+  Based on https://issues.jboss.org/browse/JBWEB-196
+  http://people.apache.org/~jfclere/patches/patch.110622.txt
+  +1: jfclere
+  -1



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



DO NOT REPLY [Bug 51414] New: TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

 Bug #: 51414
   Summary: TCP connection closes immediately after sending the
response
   Product: Tomcat 7
   Version: 7.0.14
  Platform: HP
OS/Version: Windows Vista
Status: NEW
  Severity: major
  Priority: P2
 Component: Connectors
AssignedTo: dev@tomcat.apache.org
ReportedBy: adarsh.tm...@gmail.com
Classification: Unclassified


I am using Apache Tomcat 7.0 (7.0.14 version) server. I have a requirement such
that once i make a HTTP request, and get back the response, i want to keep that
connection alive indefinitely or till the connection timeout happens. But, the
connection gets closed soon after response is sent.
I believe this a bug. 

This is the Connector tag configuration i have done in my server.xml:


Connection doesn't timeout after 200 seconds are elapsed...if i get response
after 5 secs from the time i made the request.TCP connection is closed soon
after sending response.


If not, what is the configuration i need to make on the server side. By
default, client uses HTTP/1.1 protocol version to make HTTP requests. I know
that in HTTP/1.1, the Connection is kept alive by default. I am testing this
setup on localhost.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Adarsh Mysore  changed:

   What|Removed |Added

 CC||adarsh.tm...@gmail.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Adarsh Mysore  changed:

   What|Removed |Added

   Priority|P2  |P1

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Adarsh Mysore  changed:

   What|Removed |Added

   Platform|HP  |PC

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

--- Comment #1 from Adarsh Mysore  2011-06-22 11:20:17 
UTC ---
I have tested with below 2 connector configurations tooThe issue is the
same.





Even for,



-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



crlFile and SunX509 algorithm in Tomcat 7.0.11

2011-06-22 Thread Martin Dubuc
I posted a request for help regarding an issue with configuration of CRL for
HTTPS connector on the users list but haven't receive any insights on the
matter. I am re-posting the message with summary information in hope that
someone on the dev list can help.

* * *

Up to Tomcat 7.0.10, I used the crlFile configuration along with the SunX509
algorithm in SSL HTTP connector configuration in server.xml. However, when I
start Tomcat 7.0.11, 7.0.14 or 7.0.16 with the same configuration, I get the
following error:

Jun 16, 2011 12:22:22 PM org.apache.coyote.
AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler
["http-bio-8443"]
java.io.IOException: CRLs not supported for type: SunX509
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:476)
...
Caused by: java.io.IOException: CRLs not supported for type: SunX509

at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:476)
at org.apache.tomcat.util.net.
jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:158)
...

I am using JDK 6 update 26.

Has CRL support been recently removed for SunX509 algorithm? Anybody on the
dev list would know why this might have been introduced in 7.0.11?

I have seen that some code was committed in the JSSESocketFactory class in
7.0.11, but I can't see the correlation between this change and the
exception that started to be thrown in 7.0.11.

Martin


DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WORKSFORME

--- Comment #2 from Mark Thomas  2011-06-22 13:46:12 UTC ---
This works for me.

You need to continue to use the users list to debug what is almost certainly
configuration error.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1138468 - /tomcat/tc6.0.x/trunk/STATUS.txt

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 13:56:05 2011
New Revision: 1138468

URL: http://svn.apache.org/viewvc?rev=1138468&view=rev
Log:
Vote

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=1138468&r1=1138467&r2=1138468&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun 22 13:56:05 2011
@@ -160,4 +160,6 @@ PATCHES PROPOSED TO BACKPORT:
   Based on https://issues.jboss.org/browse/JBWEB-196
   http://people.apache.org/~jfclere/patches/patch.110622.txt
   +1: jfclere
+  -1: markt Separators are defined by the HTTP specification and as per section
+2.2 of RFC 2616 must be quoted to be used within a parameter value.
   -1



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



svn commit: r1138497 - in /tomcat/trunk: java/org/apache/tomcat/util/scan/StandardJarScanner.java webapps/docs/changelog.xml

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 14:59:11 2011
New Revision: 1138497

URL: http://svn.apache.org/viewvc?rev=1138497&view=rev
Log:
Further improvements to startup performance.
Use File URLs where they can be determined for speed.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java?rev=1138497&r1=1138496&r2=1138497&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java Wed 
Jun 22 14:59:11 2011
@@ -155,7 +155,14 @@ public class StandardJarScanner implemen
 }
 URL url = null;
 try {
-url = context.getResource(path);
+// File URLs are always faster to work with so use them
+// if available.
+String realPath = context.getRealPath(path);
+if (realPath == null) {
+url = context.getResource(path);
+} else {
+url = (new File(realPath)).toURI().toURL();
+}
 process(callback, url);
 } catch (IOException e) {
 log.warn(sm.getString("jarScan.webinflibFail", url), 
e);

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1138497&r1=1138496&r2=1138497&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 22 14:59:11 2011
@@ -121,6 +121,11 @@
 51403: Avoid NPE in JULI FileHandler if formatter is
 misconfigured. (kkolinko)
   
+  
+Previous improvements in JAR scanning performance introduced a start-up
+performance penalty for some use cases. This fix addresses those
+performance penalties while retaining the original improvements. 
(markt) 
+  
 
   
   



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



DO NOT REPLY [Bug 51417] New: Apache mod_jk worker gets stuck in OK/BUSY.

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51417

 Bug #: 51417
   Summary: Apache mod_jk worker gets stuck in OK/BUSY.
   Product: Tomcat Connectors
   Version: 1.2.31
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Common
AssignedTo: dev@tomcat.apache.org
ReportedBy: smend...@redhat.com
Classification: Unclassified


Created attachment 27193
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27193
busy.patch created by Mladen turn and verified independently to fix this issue

An AJP worker can get stuck in the OK/BUSY state and - in the case of a
stateless web service - not handle any further requests. 

In jk_lb_worker.c's service(), a worker is set to busy if it can't provide a
free endpoint. If a request is finished and releases one of the worker's
endpoints then the busy state is cleared. 

The problem is that as one thread performs the final jk_sleep() in
jk_ajp_common's do_ajp_service(), all endpoints for the worker may be released. 

Now the worker is marked busy, but no requests will complete subsequently which
would clear the busy state. The worker is stuck, indefinitely. 

The problem is fairly easy to reproduce as follows: 

- Configure an lb worker with a few AJP member workers. 
- Configure one of the AJP workers with connection_pool_size=1. 
- Run only the application servers corresponding to the worker with
connection_pool_size=1. 
- Deploy a servlet that sleeps for 200ms (default 2 retries * 100ms sleep). 
- Invoke the servlet twice in parallel, via Apache and mod_jk. 

The above is a pathological setup and just for testing, however it has been
encountered in a specific use case with a web service.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51417] Apache mod_jk worker gets stuck in OK/BUSY.

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51417

Samuel Mendenhall  changed:

   What|Removed |Added

  Attachment #27193|0   |1
   is patch||
  Attachment #27193|application/octet-stream|text/plain
  mime type||
  Attachment #27193|busy.patch created by   |busy.patch created by
description|Mladen turn and verified|Mladen Turk and verified
   |independently to fix this   |independently to fix this
   |issue   |issue

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51418] New: Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51418

 Bug #: 51418
   Summary: Allow more flexibility in adding webapps to
org.apache.catalina.startup.Tomcat
   Product: Tomcat 7
   Version: 7.0.16
  Platform: PC
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: bimargul...@gmail.com
Classification: Unclassified


Created attachment 27194
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27194
A patch to Tomcat.java as described.

the Tomcat.addWebapp all create a context, set up the default realm, and set up
the surrogate global web.xml lifecycle listener. They differ according to
allowing more or less specific configuration of the new webapp. At the end,
they add the new context to the host.

Once the container is running, the act of calling addChild starts it. Some
configuration steps have to precede 'start' -- for example, setting the loader.
Thus, in a complex case, the user needs to take more control of the process.

As things are today, this requires subclassing the Tomcat class and then
copying code from the four-arg addWebapp.

The patch provided here allows non-subclasses to take complete control of the
process. It accomplishes this by providing methods to obtain three things that
are otherwise buried in the Tomcat class: the default in-memory realm, the
listener that serves as a surrogate global web.xml, and a dummy pathname to
allow the listener to work without conflicts.

Given these accessors, a user can simple create a the context (and its
ContextConfig) and configure it to their heart's content, and then pass it to
the addChild method of a Host.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51418] Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51418

bmargulies  changed:

   What|Removed |Added

  Attachment #27194|0   |1
   is patch||
  Attachment #27194|application/octet-stream|text/plain
  mime type||

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51417] Apache mod_jk worker gets stuck in OK/BUSY.

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51417

Mladen Turk  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #1 from Mladen Turk  2011-06-22 16:37:40 UTC ---
The fix was applied to the trunk as r1137160
http://svn.apache.org/viewvc?view=revision&revision=1137160

Thanks for filling the issue with the better explanation of symptoms.
I tested the patch and it cleanly applies for all mod_jk versions from
1.2.27 up, so anyone affected with the bug can use the attached patch
until 1.2.32 gets released.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51417] Apache mod_jk worker gets stuck in OK/BUSY.

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51417

--- Comment #2 from Mladen Turk  2011-06-22 16:40:31 UTC ---
Oops. Gave a wrong SVN reference. It's r1137200
http://svn.apache.org/viewvc?rev=1137200&view=rev

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1138468 - /tomcat/tc6.0.x/trunk/STATUS.txt

2011-06-22 Thread jean-frederic clere

On 06/22/2011 03:56 PM, ma...@apache.org wrote:

Author: markt
Date: Wed Jun 22 13:56:05 2011
New Revision: 1138468

URL: http://svn.apache.org/viewvc?rev=1138468&view=rev
Log:
Vote

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=1138468&r1=1138467&r2=1138468&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun 22 13:56:05 2011
@@ -160,4 +160,6 @@ PATCHES PROPOSED TO BACKPORT:
Based on https://issues.jboss.org/browse/JBWEB-196
http://people.apache.org/~jfclere/patches/patch.110622.txt
+1: jfclere
+  -1: markt Separators are defined by the HTTP specification and as per section
+2.2 of RFC 2616 must be quoted to be used within a parameter value.


If you look in org/apache/tomcat/util/http/CookieSupport.java
you will see:
private static final char[] V0_SEPARATORS = {',', ';', ' ', '\t'};

The switch is to be backward compatible with pre CVE-2007-5333 applications.

Cheers

Jean-Frederic

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



svn commit: r1138550 - /tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 16:53:58 2011
New Revision: 1138550

URL: http://svn.apache.org/viewvc?rev=1138550&view=rev
Log:
No functional change.
Refactoring so all attributes are handled the same way.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=1138550&r1=1138549&r2=1138550&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 
Wed Jun 22 16:53:58 2011
@@ -283,13 +283,12 @@ public class JSSESocketFactory implement
  * Gets the SSL server's keystore password.
  */
 protected String getKeystorePassword() {
-String keyPass = endpoint.getKeyPass();
-if (keyPass == null) {
-keyPass = DEFAULT_KEY_PASS;
-}
 String keystorePass = endpoint.getKeystorePass();
 if (keystorePass == null) {
-keystorePass = keyPass;
+keystorePass = endpoint.getKeyPass();
+}
+if (keystorePass == null) {
+keystorePass = DEFAULT_KEY_PASS;
 }
 return keystorePass;
 }



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



svn commit: r1138555 - in /tomcat/trunk: java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java webapps/docs/changelog.xml

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 17:11:03 2011
New Revision: 1138555

URL: http://svn.apache.org/viewvc?rev=1138555&view=rev
Log:
Fix copy/paste error that broke crl handling

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=1138555&r1=1138554&r2=1138555&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 
Wed Jun 22 17:11:03 2011
@@ -508,17 +508,23 @@ public class JSSESocketFactory implement
 
 @Override
 public TrustManager[] getTrustManagers() throws Exception {
-String keystoreType = endpoint.getKeystoreType();
-if (keystoreType == null) {
-keystoreType = defaultKeystoreType;
+String truststoreType = endpoint.getTruststoreType();
+if (truststoreType == null) {
+truststoreType = 
System.getProperty("javax.net.ssl.trustStoreType");
 }
-
-String algorithm = endpoint.getAlgorithm();
+if (truststoreType == null) {
+truststoreType = endpoint.getKeystoreType();
+}
+if (truststoreType == null) {
+truststoreType = defaultKeystoreType;
+}
+
+String algorithm = endpoint.getTruststoreAlgorithm();
 if (algorithm == null) {
-algorithm = KeyManagerFactory.getDefaultAlgorithm();
+algorithm = TrustManagerFactory.getDefaultAlgorithm();
 }
 
-return getTrustManagers(keystoreType, endpoint.getKeystoreProvider(),
+return getTrustManagers(truststoreType, endpoint.getKeystoreProvider(),
 algorithm);
 }
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1138555&r1=1138554&r2=1138555&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 22 17:11:03 2011
@@ -147,6 +147,10 @@
 Various refactorings to reduce code duplication and unnecessary code in
 the connectors. (markt)
   
+  
+Correct a regression introduced in Apache Tomcat 7.0.11 that broke
+certificate revokation list handling. (markt) 
+  
 
   
   



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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Adarsh Mysore  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WORKSFORME  |

--- Comment #3 from Adarsh Mysore  2011-06-22 17:55:08 
UTC ---
I will be reopening the issue. Because i am not able to figure out what is
internally happening inside the server. In the entire Apache Tomcat 7.0 server
files, the only change i have done is in the server.xml and that to changing
the below mentioned line If there is any configuration error in this please
guide me. 



Can you please reconfirm the error is something else. I will be sharing the
same with users list too. Someone has to pinpoint from the developers list that
i am wrong. At the same time, i have already shared this issue...they simply
point me to Connector common attributes page..asking me to look and at it..But,
i have read all those stuff lot more times. Please guide me in right direction.

Appreciate any positive reply.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51414] TCP connection closes immediately after sending the response

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51414

Mark Thomas  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||WORKSFORME

--- Comment #4 from Mark Thomas  2011-06-22 17:56:51 UTC ---
Again, use the users list.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1138573 - in /tomcat/trunk: java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 18:30:41 2011
New Revision: 1138573

URL: http://svn.apache.org/viewvc?rev=1138573&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51418
Provide more control over Context creation when embedding Tomcat.
Based on a patch by Benson Margulies.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=1138573&r1=1138572&r2=1138573&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Wed Jun 22 
18:30:41 2011
@@ -83,6 +83,35 @@ import org.apache.catalina.session.Stand
  * use if you have a webapp with a web.xml file, but it is 
  * optional - you can use your own servlets.
  * 
+ * There are a variety of 'add' methods to configure servlets and webapps. 
These
+ * methods, by default, create a simple in-memory security realm and apply it.
+ * If you need more complex security processing, you can define a subclass of
+ * this class.
+ * 
+ * This class provides a set of convenience methods for configuring webapp
+ * contexts, all overloads of the method addWebapp. These methods
+ * create a webapp context, configure it, and then add it to a {@link Host}.
+ * They do not use a global default web.xml; rather, they add a lifecycle
+ * listener that adds the standard DefaultServlet, JSP processing, and welcome
+ * files.
+ * 
+ * In complex cases, you may prefer to use the ordinary Tomcat API to create
+ * webapp contexts; for example, you might need to install a custom Loader
+ * before the call to {@link Host#addChild(Container)}. To replicate the basic
+ * behavior of the addWebapp methods, you may want to call three
+ * methods of this class: {@link #getDefaultRealm()}, 
+ * {@link #noDefaultWebXmlPath()}, and {@link #getDefaultWebXmlListener()}. 
+ * 
+ * {@link #getDefaultRealm()} returns the simple security realm.
+ * 
+ * {@link #getDefaultWebXmlListener()} returns a {@link LifecycleListener} that
+ * adds the standard DefaultServlet, JSP processing, and welcome files. If you
+ * add this listener, you must prevent Tomcat from applying any standard global
+ * web.xml with ...
+ * 
+ * {@link #noDefaultWebXmlPath()} returns a dummy pathname to configure to
+ * prevent {@link ContextConfig} from trying to apply a global web.xml file. 
+ * 
  * This class provides a main() and few simple CLI arguments,
  * see setters for doc. It can be used for simple tests and
  * demo.
@@ -116,9 +145,10 @@ public class Tomcat {
 // the context.
 protected Realm defaultRealm;
 private Map userPass = new HashMap();
-private Map> userRoles = 
-new HashMap>();
-private Map userPrincipals = new HashMap();
+private Map> userRoles =
+new HashMap>();
+private Map userPrincipals =
+new HashMap();
 
 public Tomcat() {
 // NOOP
@@ -511,6 +541,39 @@ public class Tomcat {
 
 return ctx;
 }
+
+/**
+ * Return a listener that provides the required configuration items for JSP
+ * processing. From the standard Tomcat global web.xml. Pass this to
+ * {@link Context#addLifecycleListener(LifecycleListener)} and then pass 
the
+ * result of {@link #noDefaultWebXmlPath()} to 
+ * {@link ContextConfig#setDefaultWebXml(String)}. 
+ * @return a listener object that configures default JSP processing.
+ */
+public LifecycleListener getDefaultWebXmlListener() {
+return new DefaultWebXmlListener();
+}
+
+/**
+ * @return a pathname to pass to
+ * {@link ContextConfig#setDefaultWebXml(String)} when using
+ * {@link #getDefaultWebXmlListener()}.
+ */
+public String noDefaultWebXmlPath() {
+return "org/apache/catalin/startup/NO_DEFAULT_XML";
+}
+
+/**
+ * For complex configurations, this accessor allows callers of this class
+ * to obtain the simple realm created by default.
+ * @return the simple in-memory realm created by default.
+ */
+public Realm getDefaultRealm() {
+if (defaultRealm == null) {
+initSimpleAuth();
+}
+return defaultRealm;
+}
 
 
 // -- Helper methods and classes ---

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1138573&r1=1138572&r2=1138573&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 22 18:30:41 2011
@@ -126,6 +126,10 @@
 performance penalty for some use cases. This fix addresses those
   

DO NOT REPLY [Bug 51418] Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51418

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
 OS/Version||All

--- Comment #1 from Mark Thomas  2011-06-22 18:31:16 UTC ---
Thanks for the patch. It has been applied with a few changes (line lengths,
spaces rather than tabs) to 7.0.x and will be included in 7.0.17 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1138468 - /tomcat/tc6.0.x/trunk/STATUS.txt

2011-06-22 Thread Mark Thomas
On 22/06/2011 17:43, jean-frederic clere wrote:
> On 06/22/2011 03:56 PM, ma...@apache.org wrote:
>> Author: markt
>> Date: Wed Jun 22 13:56:05 2011
>> New Revision: 1138468
>>
>> URL: http://svn.apache.org/viewvc?rev=1138468&view=rev
>> Log:
>> Vote
>>
>> 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=1138468&r1=1138467&r2=1138468&view=diff
>>
>> ==
>>
>> --- tomcat/tc6.0.x/trunk/STATUS.txt (original)
>> +++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun 22 13:56:05 2011
>> @@ -160,4 +160,6 @@ PATCHES PROPOSED TO BACKPORT:
>> Based on https://issues.jboss.org/browse/JBWEB-196
>> http://people.apache.org/~jfclere/patches/patch.110622.txt
>> +1: jfclere
>> +  -1: markt Separators are defined by the HTTP specification and as
>> per section
>> +2.2 of RFC 2616 must be quoted to be used within a
>> parameter value.
> 
> If you look in org/apache/tomcat/util/http/CookieSupport.java
> you will see:
> private static final char[] V0_SEPARATORS = {',', ';', ' ', '\t'};
> 
> The switch is to be backward compatible with pre CVE-2007-5333
> applications.

If I am reading the proposed patch correctly (I may have lost track of
an '!' along the way), it changes the current behaviour to prevent
switching to v1 by default.

If the purpose is to allow http separators in v0 cookies then why not
just back-port the ALLOW_HTTP_SEPARATORS_IN_V0 setting from Tomcat 7?

To be clear, I think:
- the default should remain as it is
- if a new option is introduced, it should be a port from Tomcat 7, not
an entirely new option

Mark



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



DO NOT REPLY [Bug 46221] Leak WebappClassLoader with commons-logging and log4j

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46221

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX

--- Comment #12 from Mark Thomas  2011-06-22 18:51:06 UTC ---
My original testing was against Tomcat 5.5.x and there was no leak.

Given that the logger may still be used after the web application has stopped
(e.g. to log issues during undeployment) I don't - on reflection - see a need
for this enhancement.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 46221] Leak WebappClassLoader with commons-logging and log4j

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46221

--- Comment #13 from Mauro Molinari  2011-06-22 18:57:35 
UTC ---
(In reply to comment #12)
> My original testing was against Tomcat 5.5.x and there was no leak.

Well, Tomcat 5.5.x really had the leak! My comment #9 and the attached patch
explain and demonstrate this. The fact you don't want to fix it for 5.5 is
another story.

Regarding the latest versions of Tomcat 6.x and 7.x, I didn't have the time and
the chance to test.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 50933] data corruption between mod_jk and mod_include

2011-06-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50933

--- Comment #2 from j  2011-06-22 22:24:43 UTC ---
Using apache 2.2.17 fixed the problem. In fact, 2.2.9 is the first version with
the fix. It has something to do with the buckets being released while they were
in use. See bug 7 on this page
http://www.apache.org/dist/httpd/CHANGES_2.2.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1138573 - in /tomcat/trunk: java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml

2011-06-22 Thread Konstantin Kolinko
2011/6/22  :
> Author: markt
> Date: Wed Jun 22 18:30:41 2011
> New Revision: 1138573
>
> URL: http://svn.apache.org/viewvc?rev=1138573&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51418
> Provide more control over Context creation when embedding Tomcat.
> Based on a patch by Benson Margulies.
>
> Modified:
>    tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
>    tomcat/trunk/webapps/docs/changelog.xml
>

> +    public String noDefaultWebXmlPath() {
> +        return "org/apache/catalin/startup/NO_DEFAULT_XML";
> +    }

A typo in the above constant does not prevent it from working, but
somehow bugs me.

Searching for the string finds 4 places where it is used literally.

And now it becomes part of API.

Maybe
1) s/catalin/catalina/
2) add it to o.a.c.startup.Constants, e.g. named as NoDefaultWebXml
3) use the value to short-circuit
ContextConfig#getWebXmlSource(defaultWebXml, baseDir) to return null

An alternative to 2)+3) is to put the constant into
DefaultWebXmlListener, but I like 2)+3) better.

Best regards,
Konstantin Kolinko

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



Re: svn commit: r1138573 - in /tomcat/trunk: java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml

2011-06-22 Thread Mark Thomas
On 22/06/2011 23:50, Konstantin Kolinko wrote:
> 2011/6/22  :
>> Author: markt
>> Date: Wed Jun 22 18:30:41 2011
>> New Revision: 1138573
>>
>> URL: http://svn.apache.org/viewvc?rev=1138573&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51418
>> Provide more control over Context creation when embedding Tomcat.
>> Based on a patch by Benson Margulies.
>>
>> Modified:
>>tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
>>tomcat/trunk/webapps/docs/changelog.xml
>>
> 
>> +public String noDefaultWebXmlPath() {
>> +return "org/apache/catalin/startup/NO_DEFAULT_XML";
>> +}
> 
> A typo in the above constant does not prevent it from working, but
> somehow bugs me.
> 
> Searching for the string finds 4 places where it is used literally.
> 
> And now it becomes part of API.
> 
> Maybe
> 1) s/catalin/catalina/
> 2) add it to o.a.c.startup.Constants, e.g. named as NoDefaultWebXml
> 3) use the value to short-circuit
> ContextConfig#getWebXmlSource(defaultWebXml, baseDir) to return null
> 
> An alternative to 2)+3) is to put the constant into
> DefaultWebXmlListener, but I like 2)+3) better.

Works for me. Got for it.

Mark



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



svn commit: r1138677 - in /tomcat/trunk/java/org/apache: coyote/ajp/AjpNioProtocol.java coyote/http11/Http11NioProtocol.java tomcat/util/net/NioEndpoint.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:13:37 2011
New Revision: 1138677

URL: http://svn.apache.org/viewvc?rev=1138677&view=rev
Log:
Connector refactoring.
Start moving the NIO connectors towards using SocketWrapper rather 
than NioChannel to align them with BIO/APR and permit further refactoring.
Do this in small steps since when I tried to do it in one hit, everything broke.

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138677&r1=1138676&r2=1138677&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:13:37 2011
@@ -31,6 +31,7 @@ import org.apache.tomcat.util.net.NioEnd
 import org.apache.tomcat.util.net.NioEndpoint.Handler;
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
 
 
 /**
@@ -166,7 +167,9 @@ public class AjpNioProtocol extends Abst
 }
 
 @Override
-public SocketState process(NioChannel socket, SocketStatus status) {
+public SocketState process(SocketWrapper socketWrapper,
+SocketStatus status) {
+NioChannel socket = socketWrapper.getSocket();
 AjpNioProcessor processor = connections.remove(socket);
 
 NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1138677&r1=1138676&r2=1138677&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Jun 
22 23:13:37 2011
@@ -33,6 +33,7 @@ import org.apache.tomcat.util.net.NioEnd
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.net.SecureNioChannel;
 import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
 
 
 /**
@@ -228,7 +229,9 @@ public class Http11NioProtocol extends A
 
 
 @Override
-public SocketState process(NioChannel socket, SocketStatus status) {
+public SocketState process(SocketWrapper socketWrapper,
+SocketStatus status) {
+NioChannel socket = socketWrapper.getSocket();
 Http11NioProcessor processor = connections.remove(socket);
 
 NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1138677&r1=1138676&r2=1138677&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jun 22 
23:13:37 2011
@@ -1485,7 +1485,8 @@ public class NioEndpoint extends Abstrac
  * thread local fields.
  */
 public interface Handler extends AbstractEndpoint.Handler {
-public SocketState process(NioChannel socket, SocketStatus status);
+public SocketState process(SocketWrapper socket,
+SocketStatus status);
 public void release(NioChannel socket);
 public void release(SocketChannel socket);
 public SSLImplementation getSslImplementation();
@@ -1532,9 +1533,13 @@ public class NioEndpoint extends Abstrac
 SocketState state = SocketState.OPEN;
 // Process the request from this socket
 if (status == null) {
-state = handler.process(socket, SocketStatus.OPEN);
+state = handler.process(
+(KeyAttachment) key.attachment(),
+SocketStatus.OPEN);
 } else {
-state = handler.process(socket, status);
+state = handler.process(
+(KeyAttachment) key.attachment(),
+status);
 }
 
 if (state == SocketState.CLOSED) {



-
To unsubscribe

svn commit: r1138678 - /tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:17:14 2011
New Revision: 1138678

URL: http://svn.apache.org/viewvc?rev=1138678&view=rev
Log:
Connector refactoring
Another small step towards SocketWrapper for NIO

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1138678&r1=1138677&r2=1138678&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Jun 
22 23:17:14 2011
@@ -30,6 +30,7 @@ import org.apache.tomcat.util.net.Abstra
 import org.apache.tomcat.util.net.NioChannel;
 import org.apache.tomcat.util.net.NioEndpoint;
 import org.apache.tomcat.util.net.NioEndpoint.Handler;
+import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.net.SecureNioChannel;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -234,8 +235,7 @@ public class Http11NioProtocol extends A
 NioChannel socket = socketWrapper.getSocket();
 Http11NioProcessor processor = connections.remove(socket);
 
-NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
-att.setAsync(false); //no longer check for timeout
+socketWrapper.setAsync(false); //no longer check for timeout
 
 try {
 if (processor == null) {
@@ -277,7 +277,7 @@ public class Http11NioProtocol extends A
 connections.put(socket, processor);
 
 if (processor.isAsync()) {
-att.setAsync(true);
+socketWrapper.setAsync(true);
 } else {
 // Either:
 //  - this is comet request
@@ -286,7 +286,8 @@ public class Http11NioProtocol extends A
 SelectionKey key = socket.getIOChannel().keyFor(
 socket.getPoller().getSelector());
 key.interestOps(SelectionKey.OP_READ);
-att.interestOps(SelectionKey.OP_READ);
+((KeyAttachment) socketWrapper).interestOps(
+SelectionKey.OP_READ);
 }
 } else if (state == SocketState.OPEN){
 // In keep-alive but between requests. OK to recycle



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



svn commit: r1138680 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:25:43 2011
New Revision: 1138680

URL: http://svn.apache.org/viewvc?rev=1138680&view=rev
Log:
Connector refactoring
Another small step towards SocketWrapper for NIO

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138680&r1=1138679&r2=1138680&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:25:43 2011
@@ -172,8 +172,7 @@ public class AjpNioProtocol extends Abst
 NioChannel socket = socketWrapper.getSocket();
 AjpNioProcessor processor = connections.remove(socket);
 
-NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
-att.setAsync(false); //no longer check for timeout
+socketWrapper.setAsync(false); //no longer check for timeout
 
 try {
 if (processor == null) {
@@ -201,7 +200,7 @@ public class AjpNioProtocol extends Abst
 // socket associated with the processor.
 connections.put(socket, processor);
 
-att.setAsync(true);
+socketWrapper.setAsync(true);
 } else if (state == SocketState.OPEN){
 // In keep-alive but between requests. OK to recycle
 // processor. Continue to poll for the next request.



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



svn commit: r1138681 - in /tomcat/trunk/java/org/apache: coyote/ajp/AjpNioProtocol.java coyote/http11/Http11NioProtocol.java tomcat/util/net/NioEndpoint.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:29:51 2011
New Revision: 1138681

URL: http://svn.apache.org/viewvc?rev=1138681&view=rev
Log:
Connector refactoring
Another small step towards SocketWrapper for NIO

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138681&r1=1138680&r2=1138681&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:29:51 2011
@@ -94,8 +94,8 @@ public class AjpNioProtocol extends Abst
 
 protected AjpNioProtocol proto;
 
-protected ConcurrentHashMap connections =
-new ConcurrentHashMap();
+protected ConcurrentHashMap, 
AjpNioProcessor> connections =
+new ConcurrentHashMap, 
AjpNioProcessor>();
 
 protected RecycledProcessors recycledProcessors =
 new RecycledProcessors(this);
@@ -130,10 +130,10 @@ public class AjpNioProtocol extends Abst
 if (log.isDebugEnabled()) 
 log.debug("Iterating through our connections to release a 
socket channel:"+socket);
 boolean released = false;
-Iterator> it = 
connections.entrySet().iterator();
+Iterator, 
AjpNioProcessor>> it = connections.entrySet().iterator();
 while (it.hasNext()) {
-java.util.Map.Entry entry = 
it.next();
-if (entry.getKey().getIOChannel()==socket) {
+java.util.Map.Entry, 
AjpNioProcessor> entry = it.next();
+if (entry.getKey().getSocket().getIOChannel()==socket) {
 it.remove();
 AjpNioProcessor result = entry.getValue();
 result.recycle();
@@ -151,7 +151,7 @@ public class AjpNioProtocol extends Abst
  * {@link #release(NioChannel, AjpNioProcessor)}.
  */
 @Override
-public void release(NioChannel socket) {
+public void release(SocketWrapper socket) {
 AjpNioProcessor processor = connections.remove(socket);
 if (processor != null) {
 processor.recycle();
@@ -160,7 +160,8 @@ public class AjpNioProtocol extends Abst
 }
 
 
-public void release(NioChannel socket, AjpNioProcessor processor) {
+public void release(SocketWrapper socket,
+AjpNioProcessor processor) {
 connections.remove(socket);
 processor.recycle();
 recycledProcessors.offer(processor);
@@ -170,7 +171,7 @@ public class AjpNioProtocol extends Abst
 public SocketState process(SocketWrapper socketWrapper,
 SocketStatus status) {
 NioChannel socket = socketWrapper.getSocket();
-AjpNioProcessor processor = connections.remove(socket);
+AjpNioProcessor processor = connections.remove(socketWrapper);
 
 socketWrapper.setAsync(false); //no longer check for timeout
 
@@ -198,17 +199,17 @@ public class AjpNioProtocol extends Abst
 if (state == SocketState.LONG) {
 // In the middle of processing a request/response. Keep the
 // socket associated with the processor.
-connections.put(socket, processor);
+connections.put(socketWrapper, processor);
 
 socketWrapper.setAsync(true);
 } else if (state == SocketState.OPEN){
 // In keep-alive but between requests. OK to recycle
 // processor. Continue to poll for the next request.
-release(socket, processor);
+release(socketWrapper, processor);
 socket.getPoller().add(socket);
 } else {
 // Connection closed. OK to recycle the processor.
-release(socket, processor);
+release(socketWrapper, processor);
 }
 return state;
 
@@ -231,7 +232,7 @@ public class AjpNioProtocol extends Abst
 // less-than-verbose logs.
 log.error(sm.getString("ajpprotocol.proto.error"), e);
 }
-release(socket, processor);
+release(socketWrapper, processor);
 return SocketState.CLOSED;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1138681&r1=1138680&r2=1138681&view=diff
=

svn commit: r1138682 - in /tomcat/trunk/java/org/apache/coyote: ajp/AjpNioProtocol.java http11/Http11NioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:32:17 2011
New Revision: 1138682

URL: http://svn.apache.org/viewvc?rev=1138682&view=rev
Log:
Remove the local socket object

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138682&r1=1138681&r2=1138682&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:32:17 2011
@@ -170,7 +170,6 @@ public class AjpNioProtocol extends Abst
 @Override
 public SocketState process(SocketWrapper socketWrapper,
 SocketStatus status) {
-NioChannel socket = socketWrapper.getSocket();
 AjpNioProcessor processor = connections.remove(socketWrapper);
 
 socketWrapper.setAsync(false); //no longer check for timeout
@@ -188,7 +187,7 @@ public class AjpNioProtocol extends Abst
 if (processor.isAsync() || state == SocketState.ASYNC_END) 
{
 state = processor.asyncDispatch(status);
 } else {
-state = processor.process(socket);
+state = processor.process(socketWrapper.getSocket());
 }
 
 if (processor.isAsync()) {
@@ -206,7 +205,7 @@ public class AjpNioProtocol extends Abst
 // In keep-alive but between requests. OK to recycle
 // processor. Continue to poll for the next request.
 release(socketWrapper, processor);
-socket.getPoller().add(socket);
+
socketWrapper.getSocket().getPoller().add(socketWrapper.getSocket());
 } else {
 // Connection closed. OK to recycle the processor.
 release(socketWrapper, processor);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1138682&r1=1138681&r2=1138682&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Jun 
22 23:32:17 2011
@@ -233,7 +233,6 @@ public class Http11NioProtocol extends A
 @Override
 public SocketState process(SocketWrapper socketWrapper,
 SocketStatus status) {
-NioChannel socket = socketWrapper.getSocket();
 Http11NioProcessor processor = connections.remove(socketWrapper);
 
 socketWrapper.setAsync(false); //no longer check for timeout
@@ -248,8 +247,8 @@ public class Http11NioProtocol extends A
 
 if (proto.isSSLEnabled() &&
 (proto.sslImplementation != null)
-&& (socket instanceof SecureNioChannel)) {
-SecureNioChannel ch = (SecureNioChannel)socket;
+&& (socketWrapper.getSocket() instanceof 
SecureNioChannel)) {
+SecureNioChannel ch = 
(SecureNioChannel)socketWrapper.getSocket();
 processor.setSslSupport(
 proto.sslImplementation.getSSLSupport(
 ch.getSslEngine().getSession()));
@@ -264,7 +263,7 @@ public class Http11NioProtocol extends A
 } else if (processor.comet) {
 state = processor.event(status);
 } else {
-state = processor.process(socket);
+state = processor.process(socketWrapper.getSocket());
 }
 
 if (processor.isAsync()) {
@@ -284,8 +283,8 @@ public class Http11NioProtocol extends A
 //  - this is comet request
 //  - the request line/headers have not been completely
 //read
-SelectionKey key = socket.getIOChannel().keyFor(
-socket.getPoller().getSelector());
+SelectionKey key = 
socketWrapper.getSocket().getIOChannel().keyFor(
+
socketWrapper.getSocket().getPoller().getSelector());
 key.interestOps(SelectionKey.OP_READ);
 ((KeyAttachment) socketWrapper).interestOps(
 SelectionKey.OP_READ);
@@ -294,7 +293,7 @@ public class Http11NioProtocol extends A
 // In keep-alive but between requests. OK to 

svn commit: r1138684 - in /tomcat/trunk/java/org/apache/coyote: ajp/AjpNioProtocol.java http11/Http11NioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:33:39 2011
New Revision: 1138684

URL: http://svn.apache.org/viewvc?rev=1138684&view=rev
Log:
Connector refactoring
Rename socketWrapper to socket to align with BIO/APR

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138684&r1=1138683&r2=1138684&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:33:39 2011
@@ -168,11 +168,11 @@ public class AjpNioProtocol extends Abst
 }
 
 @Override
-public SocketState process(SocketWrapper socketWrapper,
+public SocketState process(SocketWrapper socket,
 SocketStatus status) {
-AjpNioProcessor processor = connections.remove(socketWrapper);
+AjpNioProcessor processor = connections.remove(socket);
 
-socketWrapper.setAsync(false); //no longer check for timeout
+socket.setAsync(false); //no longer check for timeout
 
 try {
 if (processor == null) {
@@ -187,7 +187,7 @@ public class AjpNioProtocol extends Abst
 if (processor.isAsync() || state == SocketState.ASYNC_END) 
{
 state = processor.asyncDispatch(status);
 } else {
-state = processor.process(socketWrapper.getSocket());
+state = processor.process(socket.getSocket());
 }
 
 if (processor.isAsync()) {
@@ -198,17 +198,17 @@ public class AjpNioProtocol extends Abst
 if (state == SocketState.LONG) {
 // In the middle of processing a request/response. Keep the
 // socket associated with the processor.
-connections.put(socketWrapper, processor);
+connections.put(socket, processor);
 
-socketWrapper.setAsync(true);
+socket.setAsync(true);
 } else if (state == SocketState.OPEN){
 // In keep-alive but between requests. OK to recycle
 // processor. Continue to poll for the next request.
-release(socketWrapper, processor);
-
socketWrapper.getSocket().getPoller().add(socketWrapper.getSocket());
+release(socket, processor);
+socket.getSocket().getPoller().add(socket.getSocket());
 } else {
 // Connection closed. OK to recycle the processor.
-release(socketWrapper, processor);
+release(socket, processor);
 }
 return state;
 
@@ -231,7 +231,7 @@ public class AjpNioProtocol extends Abst
 // less-than-verbose logs.
 log.error(sm.getString("ajpprotocol.proto.error"), e);
 }
-release(socketWrapper, processor);
+release(socket, processor);
 return SocketState.CLOSED;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1138684&r1=1138683&r2=1138684&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Jun 
22 23:33:39 2011
@@ -231,11 +231,11 @@ public class Http11NioProtocol extends A
 
 
 @Override
-public SocketState process(SocketWrapper socketWrapper,
+public SocketState process(SocketWrapper socket,
 SocketStatus status) {
-Http11NioProcessor processor = connections.remove(socketWrapper);
+Http11NioProcessor processor = connections.remove(socket);
 
-socketWrapper.setAsync(false); //no longer check for timeout
+socket.setAsync(false); //no longer check for timeout
 
 try {
 if (processor == null) {
@@ -247,8 +247,8 @@ public class Http11NioProtocol extends A
 
 if (proto.isSSLEnabled() &&
 (proto.sslImplementation != null)
-&& (socketWrapper.getSocket() instanceof 
SecureNioChannel)) {
-SecureNioChannel ch = 
(SecureNioChannel)socketWrapper.getSocket();
+&& (socket.getSocket() instanceof SecureNioChannel)) {
+SecureNioChannel ch = (SecureNioCh

svn commit: r1138691 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11NioProcessor.java Http11NioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:39:05 2011
New Revision: 1138691

URL: http://svn.apache.org/viewvc?rev=1138691&view=rev
Log:
Connector refactoring
SocketWrapper changes for HTTP processor

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1138691&r1=1138690&r2=1138691&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Jun 
22 23:39:05 2011
@@ -37,6 +37,7 @@ import org.apache.tomcat.util.net.NioEnd
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SecureNioChannel;
 import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
 
 
 /**
@@ -241,15 +242,15 @@ public class Http11NioProcessor extends 
  *
  * @throws IOException error during an I/O operation
  */
-public SocketState process(NioChannel socket)
+public SocketState process(SocketWrapper socket)
 throws IOException {
 RequestInfo rp = request.getRequestProcessor();
 rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
 // Setting up the socket
-this.socket = socket;
-inputBuffer.setSocket(socket);
-outputBuffer.setSocket(socket);
+this.socket = socket.getSocket();
+inputBuffer.setSocket(this.socket);
+outputBuffer.setSocket(this.socket);
 inputBuffer.setSelectorPool(((NioEndpoint)endpoint).getSelectorPool());
 
outputBuffer.setSelectorPool(((NioEndpoint)endpoint).getSelectorPool());
 
@@ -264,15 +265,14 @@ public class Http11NioProcessor extends 
 boolean keptAlive = false;
 boolean openSocket = false;
 boolean readComplete = true;
-final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
 
 while (!error && keepAlive && !comet && !isAsync() && 
!endpoint.isPaused()) {
 //always default to our soTimeout
-ka.setTimeout(soTimeout);
+socket.setTimeout(soTimeout);
 // Parsing the request header
 try {
 if( !disableUploadTimeout && keptAlive && soTimeout > 0 ) {
-
socket.getIOChannel().socket().setSoTimeout((int)soTimeout);
+
socket.getSocket().getIOChannel().socket().setSoTimeout((int)soTimeout);
 }
 if (!inputBuffer.parseRequestLine(keptAlive)) {
 // Haven't finished reading the request so keep the socket
@@ -282,7 +282,9 @@ public class Http11NioProcessor extends 
 if (inputBuffer.getParsingRequestLinePhase()<2) {
 // No data read, OK to recycle the processor
 // Continue to use keep alive timeout
-if (keepAliveTimeout>0) 
ka.setTimeout(keepAliveTimeout);
+if (keepAliveTimeout>0) {
+socket.setTimeout(keepAliveTimeout);
+}
 } else {
 // Started to read request line. Need to keep processor
 // associated with socket
@@ -308,7 +310,7 @@ public class Http11NioProcessor extends 
 }
 request.setStartTime(System.currentTimeMillis());
 if (!disableUploadTimeout) { //only for body, not for 
request headers
-socket.getIOChannel().socket().setSoTimeout(
+
socket.getSocket().getIOChannel().socket().setSoTimeout(
 connectionUploadTimeout);
 }
 }
@@ -348,7 +350,7 @@ public class Http11NioProcessor extends 
 
 if (maxKeepAliveRequests == 1 )
 keepAlive = false;
-if (maxKeepAliveRequests > 0 && ka.decrementKeepAlive() <= 0)
+if (maxKeepAliveRequests > 0 && socket.decrementKeepAlive() <= 0)
 keepAlive = false;
 
 // Process the request in the adapter
@@ -367,7 +369,8 @@ public class Http11NioProcessor extends 
 statusDropsConnection(response.getStatus()));
 }
 // Comet support
-SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
+SelectionKey key = 
socket.getSocket().getIOChannel().keyFor(
+socket.getSocket().getPoller().getSelector());
 if (key != null) {
 NioEndpoint.KeyAttach

svn commit: r1138693 - in /tomcat/trunk: java/org/apache/catalina/startup/ test/org/apache/catalina/core/ webapps/docs/

2011-06-22 Thread kkolinko
Author: kkolinko
Date: Wed Jun 22 23:39:58 2011
New Revision: 1138693

URL: http://svn.apache.org/viewvc?rev=1138693&view=rev
Log:
Followup to r1138573
Improve support for embedding Tomcat 7.

Expose the string that was used to suppress loading default web.xml as a 
constant. Short-circuit the attempt to load the web.xml file when this magic 
value is used. Thus saving us from unneeded getResourceAsStream() call.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/Constants.java
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Constants.java?rev=1138693&r1=1138692&r2=1138693&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/Constants.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Constants.java Wed Jun 22 
23:39:58 2011
@@ -38,6 +38,18 @@ public final class Constants {
 public static final String HostContextXml = "context.xml.default";
 public static final String HostWebXml = "web.xml.default";
 
+/**
+ * A dummy value used to suppress loading the default web.xml file.
+ *
+ * 
+ * It is useful when embedding Tomcat, when the default configuration is
+ * done programmatically, e.g. by calling
+ * Tomcat.initWebappDefaults(context).
+ *
+ * @see Tomcat
+ */
+public static final String NoDefaultWebXml = 
"org/apache/catalina/startup/NO_DEFAULT_XML";
+
 // J2EE
 public static final String J2eeSchemaPublicId_14 =
 "j2ee_1_4.xsd";

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1138693&r1=1138692&r2=1138693&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Wed Jun 22 
23:39:58 2011
@@ -1589,6 +1589,10 @@ public class ContextConfig
 // Set the default if we don't have any overrides
 if (defaultWebXml == null) getDefaultWebXml();
 
+// Is it explicitly suppressed, e.g. in embedded environment?
+if (Constants.NoDefaultWebXml.equals(defaultWebXml)) {
+return null;
+}
 return getWebXmlSource(defaultWebXml, getBaseDir());
 }
 

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=1138693&r1=1138692&r2=1138693&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Wed Jun 22 
23:39:58 2011
@@ -531,8 +531,8 @@ public class Tomcat {
 ctx.addLifecycleListener(ctxCfg);
 
 // prevent it from looking ( if it finds one - it'll have dup error )
-ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
-
+ctxCfg.setDefaultWebXml(noDefaultWebXmlPath());
+
 if (host == null) {
 getHost().addChild(ctx);
 } else {
@@ -560,7 +560,7 @@ public class Tomcat {
  * {@link #getDefaultWebXmlListener()}.
  */
 public String noDefaultWebXmlPath() {
-return "org/apache/catalin/startup/NO_DEFAULT_XML";
+return Constants.NoDefaultWebXml;
 }
 
 /**

Modified: 
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java?rev=1138693&r1=1138692&r2=1138693&view=diff
==
--- 
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java 
(original)
+++ 
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java 
Wed Jun 22 23:39:58 2011
@@ -33,6 +33,7 @@ import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.deploy.WebXml;
+import org.apache.catalina.startup.Constants;
 import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
@@ -124,7 +125,7 @@ public class TestStandardContextResource
 }
 };
 // prevent it from looking ( if it finds one - it'll have dup error )
-config.setDefa

svn commit: r1138694 - in /tomcat/trunk/java/org/apache/coyote/ajp: AjpNioProcessor.java AjpNioProtocol.java

2011-06-22 Thread markt
Author: markt
Date: Wed Jun 22 23:40:30 2011
New Revision: 1138694

URL: http://svn.apache.org/viewvc?rev=1138694&view=rev
Log:
Connector refactoring
SocketWrapper changes for AJP processor

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1138694&r1=1138693&r2=1138694&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Wed Jun 22 
23:40:30 2011
@@ -39,6 +39,7 @@ import org.apache.tomcat.util.net.NioEnd
 import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
 import org.apache.tomcat.util.net.NioSelectorPool;
 import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
 
 
 /**
@@ -100,13 +101,13 @@ public class AjpNioProcessor extends Abs
  *
  * @throws IOException error during an I/O operation
  */
-public SocketState process(NioChannel socket)
+public SocketState process(SocketWrapper socket)
 throws IOException {
 RequestInfo rp = request.getRequestProcessor();
 rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
 // Setting up the socket
-this.socket = socket;
+this.socket = socket.getSocket();
 
 long soTimeout = endpoint.getSoTimeout();
 int keepAliveTimeout = endpoint.getKeepAliveTimeout();
@@ -114,8 +115,6 @@ public class AjpNioProcessor extends Abs
 // Error flag
 error = false;
 
-final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
-
 while (!error && !endpoint.isPaused()) {
 // Parsing the request header
 try {
@@ -127,7 +126,7 @@ public class AjpNioProcessor extends Abs
 }
 // Set back timeout if keep alive timeout is enabled
 if (keepAliveTimeout > 0) {
-ka.setTimeout(soTimeout);
+socket.setTimeout(soTimeout);
 }
 // Check message type, process right away and break if
 // not regular request processing
@@ -224,7 +223,7 @@ public class AjpNioProcessor extends Abs
 rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
 // Set keep alive timeout if enabled
 if (keepAliveTimeout > 0) {
-ka.setTimeout(keepAliveTimeout);
+socket.setTimeout(keepAliveTimeout);
 }
 
 recycle();

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138694&r1=1138693&r2=1138694&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 
23:40:30 2011
@@ -187,7 +187,7 @@ public class AjpNioProtocol extends Abst
 if (processor.isAsync() || state == SocketState.ASYNC_END) 
{
 state = processor.asyncDispatch(status);
 } else {
-state = processor.process(socket.getSocket());
+state = processor.process(socket);
 }
 
 if (processor.isAsync()) {



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



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

2011-06-22 Thread kkolinko
Author: kkolinko
Date: Thu Jun 23 00:10:23 2011
New Revision: 1138697

URL: http://svn.apache.org/viewvc?rev=1138697&view=rev
Log:
Amend description for the fix applied in r1132700.
The problem there was less severe than it sounds:
The port number was not treated as hex. The arithmetics to summ up the digits 
has already been using base 10.

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

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1138697&r1=1138696&r2=1138697&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 23 00:10:23 2011
@@ -263,8 +263,9 @@
   
 
   
-When parsing the port in the HTTP host header, treat the port as a base
-10 integer rather than a hexadecimal one. (rjung/markt/kkolinko) 
+When parsing the port in the HTTP host header, restrict the value to be
+base 10 integer digits rather than hexadecimal ones.
+(rjung/markt/kkolinko) 
   
   
 Various refactorings to reduce code duplication and unnecessary code in



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