JBossWeb SVN: r583 - in trunk: conf and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-04-15 09:54:17 -0400 (Tue, 15 Apr 2008)
New Revision: 583
Modified:
trunk/conf/web.xml
trunk/dist.xml
Log:
- Two cosmetic updates.
Modified: trunk/conf/web.xml
===================================================================
--- trunk/conf/web.xml 2008-04-10 00:39:22 UTC (rev 582)
+++ trunk/conf/web.xml 2008-04-15 13:54:17 UTC (rev 583)
@@ -253,11 +253,6 @@
<!-- -->
<!-- outputEncoding The encoding to use for the page that results -->
<!-- from the SSI processing. [UTF-8] -->
- <!-- -->
- <!-- -->
- <!-- IMPORTANT: To use the SSI servlet, you also need to rename the -->
- <!-- $CATALINA_HOME/server/lib/servlets-ssi.renametojar file -->
- <!-- to $CATALINA_HOME/server/lib/servlets-ssi.jar -->
<!--
<servlet>
@@ -310,10 +305,6 @@
<!-- -->
<!-- passShellEnvironment Should the shell environment variables (if -->
<!-- any) be passed to the CGI script? [false] -->
- <!-- -->
- <!-- IMPORTANT: To use the CGI servlet, you also need to rename the -->
- <!-- $CATALINA_HOME/server/lib/servlets-cgi.renametojar file -->
- <!-- to $CATALINA_HOME/server/lib/servlets-cgi.jar -->
<!--
<servlet>
Modified: trunk/dist.xml
===================================================================
--- trunk/dist.xml 2008-04-10 00:39:22 UTC (rev 582)
+++ trunk/dist.xml 2008-04-15 13:54:17 UTC (rev 583)
@@ -134,7 +134,7 @@
</target>
- <target name="dist-javadoc" description="Create the Tomcat javadoc" >
+ <target name="dist-javadoc" depends="dist-source" description="Create the Tomcat javadoc" >
<javadoc packagenames="org.apache.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/api"
16 years, 8 months
JBossWeb SVN: r582 - in trunk: java/org/apache/el/lang and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-04-09 20:39:22 -0400 (Wed, 09 Apr 2008)
New Revision: 582
Modified:
trunk/conf/catalina.policy
trunk/java/org/apache/el/lang/FunctionMapperImpl.java
trunk/java/org/apache/juli/ClassLoaderLogManager.java
trunk/webapps/docs/changelog.xml
Log:
- Port 3 Tomcat patches.
- NPE in function mapper.
- Permission improvements in JULI.
Modified: trunk/conf/catalina.policy
===================================================================
--- trunk/conf/catalina.policy 2008-04-10 00:06:14 UTC (rev 581)
+++ trunk/conf/catalina.policy 2008-04-10 00:39:22 UTC (rev 582)
@@ -49,6 +49,7 @@
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.util.PropertyPermission "java.util.logging.config.class", "read";
permission java.util.PropertyPermission "java.util.logging.config.file", "read";
+ permission java.io.FilePermission "${java.home}${file.separator}lib${file.separator}logging.properties", "read";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
permission java.util.PropertyPermission "catalina.base", "read";
Modified: trunk/java/org/apache/el/lang/FunctionMapperImpl.java
===================================================================
--- trunk/java/org/apache/el/lang/FunctionMapperImpl.java 2008-04-10 00:06:14 UTC (rev 581)
+++ trunk/java/org/apache/el/lang/FunctionMapperImpl.java 2008-04-10 00:39:22 UTC (rev 582)
@@ -120,6 +120,8 @@
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF((this.prefix != null) ? this.prefix : "");
out.writeUTF(this.localName);
+ // make sure m isn't null
+ getMethod();
out.writeUTF((this.owner != null) ?
this.owner :
this.m.getDeclaringClass().getName());
Modified: trunk/java/org/apache/juli/ClassLoaderLogManager.java
===================================================================
--- trunk/java/org/apache/juli/ClassLoaderLogManager.java 2008-04-10 00:06:14 UTC (rev 581)
+++ trunk/java/org/apache/juli/ClassLoaderLogManager.java 2008-04-10 00:39:22 UTC (rev 582)
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URLClassLoader;
+import java.security.AccessControlException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
@@ -296,9 +297,14 @@
InputStream is = null;
// Special case for URL classloaders which are used in containers:
// only look in the local repositories to avoid redefining loggers 20 times
- if ((classLoader instanceof URLClassLoader)
- && (((URLClassLoader) classLoader).findResource("logging.properties") != null)) {
- is = classLoader.getResourceAsStream("logging.properties");
+ try {
+ if ((classLoader instanceof URLClassLoader)
+ && (((URLClassLoader) classLoader).findResource("logging.properties") != null)) {
+ is = classLoader.getResourceAsStream("logging.properties");
+ }
+ } catch (AccessControlException ace) {
+ // No permission to configure logging in context
+ // Ignore and carry on
}
if ((is == null) && (classLoader == ClassLoader.getSystemClassLoader())) {
String configFileStr = System.getProperty("java.util.logging.config.file");
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-04-10 00:06:14 UTC (rev 581)
+++ trunk/webapps/docs/changelog.xml 2008-04-10 00:39:22 UTC (rev 582)
@@ -57,6 +57,10 @@
<bug>44646</bug>: Fix tracking problems in the Comet utility valve (which provides
notification for certain events such as session expiration and server shutdown). (markt)
</fix>
+ <fix>
+ Better handling of lack of permission for context specific logging, and add permission
+ for reading the JDK logging.properties. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -103,8 +107,11 @@
<subsection name="Jasper">
<changelog>
<fix>
- Port Tomcat fix for bugzilla 42693. (jfclere).
+ <bug>42693</bug>: Port Tomcat fix for bugzilla 42693. (jfclere).
</fix>
+ <fix>
+ <bug>44428</bug>: NPE in function mapper. (markt)
+ </fix>
</changelog>
</subsection>
</section>
16 years, 8 months
JBossWeb SVN: r581 - in trunk: java/org/jboss/web/cluster and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-04-09 20:06:14 -0400 (Wed, 09 Apr 2008)
New Revision: 581
Modified:
trunk/build.xml
trunk/java/org/jboss/web/cluster/ClusterListener.java
Log:
- Add skeleton listener for cluster. Normally, this should be per engine configuration (since engine holds
the jvmRoute), but ...
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-04-07 11:48:48 UTC (rev 580)
+++ trunk/build.xml 2008-04-10 00:06:14 UTC (rev 581)
@@ -48,7 +48,7 @@
<property name="el-api.jar" value="${tomcat.build}/lib/el-api.jar"/>
<property name="catalina.jar" value="${tomcat.build}/lib/catalina.jar"/>
<property name="catalina-ant.jar" value="${tomcat.build}/lib/catalina-ant.jar"/>
- <property name="catalina-ant-jmx.jar" value="${tomcat.build}/lib/catalina-ant-jmx.jar"/>
+ <property name="catalina-optional.jar" value="${tomcat.build}/lib/catalina-optional.jar"/>
<property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>
<property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
Modified: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-04-07 11:48:48 UTC (rev 580)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-04-10 00:06:14 UTC (rev 581)
@@ -24,31 +24,30 @@
package org.jboss.web.cluster;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
+import org.apache.catalina.Container;
+import org.apache.catalina.ContainerEvent;
+import org.apache.catalina.ContainerListener;
+import org.apache.catalina.Context;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
import org.apache.catalina.util.StringManager;
-import org.apache.tomcat.jni.Library;
import org.jboss.logging.Logger;
-import org.jboss.logging.Logger;
/**
- * Implementation of <code>LifecycleListener</code> that will init and
- * and destroy APR.
- *
- * @author Remy Maucherat
- * @author Filip Hanik
- * @version $Revision: 515 $ $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
- * @since 4.1
+ *
*/
public class ClusterListener
- implements LifecycleListener {
+ implements LifecycleListener, ContainerListener {
private static Logger log = Logger.getLogger(ClusterListener.class);
@@ -65,6 +64,39 @@
// ---------------------------------------------- Properties
+ /**
+ * Acknowledge the occurrence of the specified event.
+ * Note: Will never be called when the listener is associated to a Server,
+ * since it is not a Container.
+ *
+ * @param event ContainerEvent that has occurred
+ */
+ public void containerEvent(ContainerEvent event) {
+
+ Container container = event.getContainer();
+ Object child = event.getData();
+ String type = event.getType();
+
+ if (type.equals(Container.ADD_CHILD_EVENT)) {
+ if (container instanceof Host) {
+ // Deploying a webapp
+ addContext((Context) child);
+ } else if (container instanceof Engine) {
+ // Deploying a host
+ container.addContainerListener(this);
+ }
+ } else if (type.equals(Container.REMOVE_CHILD_EVENT)) {
+ if (container instanceof Host) {
+ // Undeploying a webapp
+ removeContext((Context) child);
+ } else if (container instanceof Engine) {
+ // Undeploying a host
+ container.removeContainerListener(this);
+ }
+ }
+
+ }
+
// ---------------------------------------------- LifecycleListener Methods
/**
@@ -74,12 +106,101 @@
*/
public void lifecycleEvent(LifecycleEvent event) {
+ Object source = event.getLifecycle();
+
if (Lifecycle.START_EVENT.equals(event.getType())) {
-
+ if (source instanceof Context) {
+ // Start a webapp
+ startContext((Context) source);
+ } else if (source instanceof Server) {
+ Service[] services = ((Server) source).findServices();
+ for (int i = 0; i < services.length; i++) {
+ services[i].getContainer().addContainerListener(this);
+ ((Lifecycle) services[i].getContainer()).addLifecycleListener(this);
+ config((Engine) services[i].getContainer());
+ Container[] children = services[i].getContainer().findChildren();
+ for (int j = 0; j < children.length; j++) {
+ children[j].addContainerListener(this);
+ Container[] children2 = children[j].findChildren();
+ for (int k = 0; k < children2.length; k++) {
+ addContext((Context) children2[k]);
+ }
+ }
+ }
+ } else {
+ return;
+ }
} else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
-
+ if (source instanceof Context) {
+ // Stop a webapp
+ stopContext((Context) source);
+ } else if (source instanceof Server) {
+ Service[] services = ((Server) source).findServices();
+ for (int i = 0; i < services.length; i++) {
+ services[i].getContainer().removeContainerListener(this);
+ Container[] children = services[i].getContainer().findChildren();
+ for (int j = 0; j < children.length; j++) {
+ children[j].removeContainerListener(this);
+ Container[] children2 = children[j].findChildren();
+ for (int k = 0; k < children2.length; k++) {
+ removeContext((Context) children2[k]);
+ }
+ }
+ }
+ } else {
+ return;
+ }
+ } else if (Lifecycle.PERIODIC_EVENT.equals(event.getType())) {
+ if (source instanceof Engine) {
+ status((Engine) source);
+ }
}
}
+
+
+ protected void config(Engine engine) {
+ System.out.println("Config: " + engine.getName());
+ // FIXME: collect configuration from the connectors and service and call CONFIG
+ Service service = engine.getService();
+ Connector[] connectors = service.findConnectors();
+ }
+
+ protected void status(Engine engine) {
+ System.out.println("Status: " + engine.getName());
+ // FIXME: send STATUS
+ Service service = engine.getService();
+ Connector[] connectors = service.findConnectors();
+ }
+
+
+ protected void addContext(Context context) {
+ System.out.println("Deploy context: " + context.getPath() + " to Host: " + context.getParent().getName() + " State: " + ((StandardContext) context).getState());
+ ((Lifecycle) context).addLifecycleListener(this);
+ // FIXME: send ENABLE-APP if state is started
+ }
+
+
+ protected void removeContext(Context context) {
+ System.out.println("Undeploy context: " + context.getPath() + " to Host: " + context.getParent().getName() + " State: " + ((StandardContext) context).getState());
+ ((Lifecycle) context).removeLifecycleListener(this);
+ // FIXME: send REMOVE-APP
+ }
+
+
+ protected void startContext(Context context) {
+ Container parent = context.getParent();
+ System.out.println("Start context: " + context.getPath() + " to Host: " + parent.getName());
+ // FIXME: send ENABLE-APP
+ }
+
+
+ protected void stopContext(Context context) {
+ Container parent = context.getParent();
+ System.out.println("Stop context: " + context.getPath() + " to Host: " + parent.getName());
+ // FIXME: send STOP-APP
+ }
+
+
}
16 years, 8 months
JBossWeb SVN: r580 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-04-07 07:48:48 -0400 (Mon, 07 Apr 2008)
New Revision: 580
Modified:
trunk/java/org/apache/catalina/core/StandardThreadExecutor.java
Log:
Submitted by Ruediger Pluem. PR#44595.
Allows to check the QueueSize of an executor via JMX.
Modified: trunk/java/org/apache/catalina/core/StandardThreadExecutor.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardThreadExecutor.java 2008-04-02 13:03:35 UTC (rev 579)
+++ trunk/java/org/apache/catalina/core/StandardThreadExecutor.java 2008-04-07 11:48:48 UTC (rev 580)
@@ -193,6 +193,10 @@
return (executor != null) ? executor.getPoolSize() : 0;
}
+ public int getQueueSize() {
+ return (executor != null) ? executor.getQueue().size() : -1;
+ }
+
// ---------------------------------------------- TaskQueue Inner Class
class TaskQueue extends LinkedBlockingQueue<Runnable> {
ThreadPoolExecutor parent = null;
@@ -254,4 +258,4 @@
}
-}
\ No newline at end of file
+}
16 years, 8 months
JBossWeb SVN: r579 - trunk/res/procrun.
by jbossweb-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 09:03:35 -0400 (Wed, 02 Apr 2008)
New Revision: 579
Modified:
trunk/res/procrun/jbossweb.exe
trunk/res/procrun/jbossweb.i64.exe
trunk/res/procrun/jbossweb.x64.exe
trunk/res/procrun/jbosswebw.exe
Log:
Update binaries with correct stack size (like JVM) has
Modified: trunk/res/procrun/jbossweb.exe
===================================================================
(Binary files differ)
Modified: trunk/res/procrun/jbossweb.i64.exe
===================================================================
(Binary files differ)
Modified: trunk/res/procrun/jbossweb.x64.exe
===================================================================
(Binary files differ)
Modified: trunk/res/procrun/jbosswebw.exe
===================================================================
(Binary files differ)
16 years, 8 months
JBossWeb SVN: r578 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/jasper/compiler.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-04-01 11:48:09 -0400 (Tue, 01 Apr 2008)
New Revision: 578
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/jasper/compiler/Compiler.java
Log:
Fix bugzilla 42693 for case 171944.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/jasper/compiler/Compiler.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/jasper/compiler/Compiler.java 2008-04-01 15:37:54 UTC (rev 577)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/jasper/compiler/Compiler.java 2008-04-01 15:48:09 UTC (rev 578)
@@ -141,24 +141,10 @@
ctxt.checkOutputDir();
String javaFileName = ctxt.getServletJavaFileName();
+
ServletWriter writer = null;
-
try {
- // Setup the ServletWriter
- String javaEncoding = ctxt.getOptions().getJavaEncoding();
- OutputStreamWriter osw = null;
- try {
- osw = new OutputStreamWriter(
- new FileOutputStream(javaFileName), javaEncoding);
- } catch (UnsupportedEncodingException ex) {
- errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
- javaEncoding);
- }
-
- writer = new ServletWriter(new PrintWriter(osw));
- ctxt.setWriter(writer);
-
// Reset the temporary variable counter for the generator.
JspUtil.resetTemporaryVariableName();
@@ -168,6 +154,7 @@
if (ctxt.isPrototypeMode()) {
// generate prototype .java file for the tag file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
@@ -207,6 +194,7 @@
ELFunctionMapper.map(this, pageNodes);
// generate servlet .java file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
@@ -259,6 +247,26 @@
return smapStr;
}
+ private ServletWriter setupContextWriter(String javaFileName)
+ throws FileNotFoundException, JasperException {
+ ServletWriter writer;
+ // Setup the ServletWriter
+ String javaEncoding = ctxt.getOptions().getJavaEncoding();
+ OutputStreamWriter osw = null;
+
+ try {
+ osw = new OutputStreamWriter(
+ new FileOutputStream(javaFileName), javaEncoding);
+ } catch (UnsupportedEncodingException ex) {
+ errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
+ javaEncoding);
+ }
+
+ writer = new ServletWriter(new PrintWriter(osw));
+ ctxt.setWriter(writer);
+ return writer;
+ }
+
/**
* Compile the servlet from .java file to .class file
*/
16 years, 8 months
JBossWeb SVN: r577 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-04-01 11:37:54 -0400 (Tue, 01 Apr 2008)
New Revision: 577
Modified:
trunk/java/org/apache/jasper/compiler/Compiler.java
trunk/webapps/docs/changelog.xml
Log:
Fix bugzilla 42693 for case 171944.
Modified: trunk/java/org/apache/jasper/compiler/Compiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Compiler.java 2008-04-01 13:08:39 UTC (rev 576)
+++ trunk/java/org/apache/jasper/compiler/Compiler.java 2008-04-01 15:37:54 UTC (rev 577)
@@ -142,24 +142,10 @@
ctxt.checkOutputDir();
String javaFileName = ctxt.getServletJavaFileName();
+
ServletWriter writer = null;
-
try {
- // Setup the ServletWriter
- String javaEncoding = ctxt.getOptions().getJavaEncoding();
- OutputStreamWriter osw = null;
- try {
- osw = new OutputStreamWriter(
- new FileOutputStream(javaFileName), javaEncoding);
- } catch (UnsupportedEncodingException ex) {
- errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
- javaEncoding);
- }
-
- writer = new ServletWriter(new PrintWriter(osw));
- ctxt.setWriter(writer);
-
// Reset the temporary variable counter for the generator.
JspUtil.resetTemporaryVariableName();
@@ -169,6 +155,7 @@
if (ctxt.isPrototypeMode()) {
// generate prototype .java file for the tag file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
@@ -208,6 +195,7 @@
ELFunctionMapper.map(this, pageNodes);
// generate servlet .java file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
@@ -260,6 +248,26 @@
return smapStr;
}
+ private ServletWriter setupContextWriter(String javaFileName)
+ throws FileNotFoundException, JasperException {
+ ServletWriter writer;
+ // Setup the ServletWriter
+ String javaEncoding = ctxt.getOptions().getJavaEncoding();
+ OutputStreamWriter osw = null;
+
+ try {
+ osw = new OutputStreamWriter(
+ new FileOutputStream(javaFileName), javaEncoding);
+ } catch (UnsupportedEncodingException ex) {
+ errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
+ javaEncoding);
+ }
+
+ writer = new ServletWriter(new PrintWriter(osw));
+ ctxt.setWriter(writer);
+ return writer;
+ }
+
/**
* Compile the servlet from .java file to .class file
*/
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-04-01 13:08:39 UTC (rev 576)
+++ trunk/webapps/docs/changelog.xml 2008-04-01 15:37:54 UTC (rev 577)
@@ -8,6 +8,7 @@
<properties>
<author email="remm(a)apache.org">Remy Maucherat</author>
+ <author email="jfclere(a)apache.org">Jean-Frederic Clere</author>
<author email="yoavs(a)apache.org">Yoav Shapira</author>
<author email="fhanik(a)apache.org">Filip Hanik</author>
<title>Changelog</title>
@@ -99,6 +100,13 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ Port Tomcat fix for bugzilla 42693. (jfclere).
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 2.1.0 (remm)">
16 years, 8 months
JBossWeb SVN: r576 - in trunk: webapps/docs and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-04-01 09:08:39 -0400 (Tue, 01 Apr 2008)
New Revision: 576
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/coyote/http11/Http11Processor.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/http.xml
Log:
- maxSavePostSize == 0 should disable buffering for SSL handshake.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-04-01 12:22:38 UTC (rev 575)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-04-01 13:08:39 UTC (rev 576)
@@ -1226,7 +1226,7 @@
if (ssl && (socket != 0)) {
// Consume and buffer the request body, so that it does not
// interfere with the client's handshake messages
- if (maxSavePostSize > -2) {
+ if (maxSavePostSize != 0) {
InputFilter[] inputFilters = inputBuffer.getFilters();
((BufferedInputFilter) inputFilters[Constants.BUFFERED_FILTER]).setLimit(maxSavePostSize);
inputBuffer.addActiveFilter(inputFilters[Constants.BUFFERED_FILTER]);
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-04-01 12:22:38 UTC (rev 575)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-04-01 13:08:39 UTC (rev 576)
@@ -1081,15 +1081,13 @@
} else if (actionCode == ActionCode.ACTION_REQ_SSL_CERTIFICATE) {
if( sslSupport != null) {
- /*
- * Consume and buffer the request body, so that it does not
- * interfere with the client's handshake messages
- */
- InputFilter[] inputFilters = inputBuffer.getFilters();
- ((BufferedInputFilter) inputFilters[Constants.BUFFERED_FILTER])
- .setLimit(maxSavePostSize);
- inputBuffer.addActiveFilter
- (inputFilters[Constants.BUFFERED_FILTER]);
+ // Consume and buffer the request body, so that it does not
+ // interfere with the client's handshake messages
+ if (maxSavePostSize != 0) {
+ InputFilter[] inputFilters = inputBuffer.getFilters();
+ ((BufferedInputFilter) inputFilters[Constants.BUFFERED_FILTER]).setLimit(maxSavePostSize);
+ inputBuffer.addActiveFilter(inputFilters[Constants.BUFFERED_FILTER]);
+ }
try {
Object sslO = sslSupport.getPeerCertificateChain(true);
if( sslO != null) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-04-01 12:22:38 UTC (rev 575)
+++ trunk/webapps/docs/changelog.xml 2008-04-01 13:08:39 UTC (rev 576)
@@ -93,6 +93,10 @@
Repackage MimeHeaders and Parameters using inner classes, and remove all obsolete
collections. (remm)
</update>
+ <fix>
+ maxSavePostSize set to 0 for HTTP connectors should disable buffering done before SSL
+ handshake. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Modified: trunk/webapps/docs/config/http.xml
===================================================================
--- trunk/webapps/docs/config/http.xml 2008-04-01 12:22:38 UTC (rev 575)
+++ trunk/webapps/docs/config/http.xml 2008-04-01 13:08:39 UTC (rev 576)
@@ -81,20 +81,14 @@
the container during FORM or CLIENT-CERT authentication. For both types
of authentication, the POST will be saved/buffered before the user is
authenticated. For CLIENT-CERT authentication, the POST is buffered for
- the duration of
- the SSL handshake and the buffer emptied when the request
- is processed. For FORM authentication the POST is
- saved whilst the user
+ the duration of the SSL handshake and the buffer emptied when the request
+ is processed. For FORM authentication the POST is saved whilst the user
is re-directed to the login form and is retained until the user
successfully authenticates or the session associated with the
authentication request expires. The limit can be disabled by setting this
- attribute to -1. Setting the attribute to
- zero will disable the saving of
- POST data during authentication
-. If not
- specified, this attribute is set
- to
- 4096 (4 kilobytes).</p>
+ attribute to -1. Setting the attribute to zero will disable the saving of
+ POST data during authentication and the buffering during SSL handshake.
+ If not specified, this attribute is set to 4096 (4 kilobytes).</p>
</attribute>
<attribute name="protocol" required="false">
16 years, 8 months
JBossWeb SVN: r575 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-04-01 08:22:38 -0400 (Tue, 01 Apr 2008)
New Revision: 575
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
Log:
- A fancy client properly implementing continue could be impacted by the buffering hack, so allow
disabling it in the APR connector just in case.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-04-01 00:45:28 UTC (rev 574)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-04-01 12:22:38 UTC (rev 575)
@@ -1226,9 +1226,11 @@
if (ssl && (socket != 0)) {
// Consume and buffer the request body, so that it does not
// interfere with the client's handshake messages
- InputFilter[] inputFilters = inputBuffer.getFilters();
- ((BufferedInputFilter) inputFilters[Constants.BUFFERED_FILTER]).setLimit(maxSavePostSize);
- inputBuffer.addActiveFilter(inputFilters[Constants.BUFFERED_FILTER]);
+ if (maxSavePostSize > -2) {
+ InputFilter[] inputFilters = inputBuffer.getFilters();
+ ((BufferedInputFilter) inputFilters[Constants.BUFFERED_FILTER]).setLimit(maxSavePostSize);
+ inputBuffer.addActiveFilter(inputFilters[Constants.BUFFERED_FILTER]);
+ }
try {
// Renegociate certificates
SSLSocket.renegotiate(socket);
16 years, 8 months
JBossWeb SVN: r574 - trunk/java/org/apache/tomcat/util/buf.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-31 20:45:28 -0400 (Mon, 31 Mar 2008)
New Revision: 574
Modified:
trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
Log:
- Cleanup, no change.
Modified: trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2008-03-31 16:23:06 UTC (rev 573)
+++ trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2008-04-01 00:45:28 UTC (rev 574)
@@ -26,7 +26,7 @@
import java.nio.charset.CoderResult;
/**
- * Helper class to handle byte to char conversion using NIO.
+ * NIO based character decoder.
*
* @author Remy Maucherat
*/
@@ -54,10 +54,18 @@
}
/**
- * Convert the given bytes to chars.
+ * Reset the decoder state, and empty the leftover buffer.
+ */
+ public void recycle() {
+ decoder.reset();
+ leftovers.position(0);
+ }
+
+ /**
+ * Convert the given bytes to characters.
*
- * @param bc
- * @param cc
+ * @param bc byte input
+ * @param cc char output
*/
public void convert(ByteChunk bc, CharChunk cc)
throws IOException {
@@ -78,10 +86,11 @@
cb.position(cc.getEnd());
cb.limit(cc.getBuffer().length);
}
+ CoderResult result = null;
// Parse leftover if any are present
- CoderResult result = null;
if (leftovers.position() > 0) {
int pos = cb.position();
+ // Loop until one char is decoded or there is a decoder error
do {
leftovers.put(bc.substractB());
leftovers.flip();
@@ -117,13 +126,4 @@
}
}
- /**
- * Reset the internal state, empty the buffers.
- * The encoding remain in effect, the internal buffers remain allocated.
- */
- public void recycle() {
- decoder.reset();
- leftovers.position(0);
- }
-
}
Modified: trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2008-03-31 16:23:06 UTC (rev 573)
+++ trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2008-04-01 00:45:28 UTC (rev 574)
@@ -26,8 +26,10 @@
/**
* NIO based character encoder.
+ *
+ * @author Remy Maucherat
*/
-public final class C2BConverter {
+public class C2BConverter {
protected static org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(C2BConverter.class);
@@ -44,14 +46,17 @@
}
/**
- * The encoding remain in effect, the encoder remains allocated.
+ * Reset the encoder state.
*/
public void recycle() {
encoder.reset();
}
/**
- * Convert the given charaters to bytes.
+ * Convert the given characters to bytes.
+ *
+ * @param cc char input
+ * @param bc byte output
*/
public void convert(CharChunk cc, ByteChunk bc)
throws IOException {
@@ -73,10 +78,8 @@
cb.position(cc.getStart());
cb.limit(cc.getEnd());
}
- // Parse leftover if any are present
- CoderResult result = null;
// Do the decoding and get the results into the byte chunk and the char chunk
- result = encoder.encode(cb, bb, false);
+ CoderResult result = encoder.encode(cb, bb, false);
if (result.isError() || result.isMalformed()) {
result.throwException();
} else if (result.isOverflow()) {
16 years, 8 months