JBossWeb SVN: r395 - trunk/java/org/jboss/web/php.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-01-17 10:37:06 -0500 (Thu, 17 Jan 2008)
New Revision: 395
Modified:
trunk/java/org/jboss/web/php/Handler.java
Log:
Typo in the error message.
Modified: trunk/java/org/jboss/web/php/Handler.java
===================================================================
--- trunk/java/org/jboss/web/php/Handler.java 2008-01-17 15:34:10 UTC (rev 394)
+++ trunk/java/org/jboss/web/php/Handler.java 2008-01-17 15:37:06 UTC (rev 395)
@@ -187,7 +187,7 @@
// Verify that we were not accessed using the invoker servlet
if (req.getAttribute(Globals.INVOKED_ATTR) != null)
throw new UnavailableException
- ("Cannot invoke PHP Getaway Handler through the invoker");
+ ("Cannot invoke PHP Gateway Handler through the invoker");
ScriptEnvironment env = new ScriptEnvironment(req,
getServletContext(),
16 years, 11 months
JBossWeb SVN: r394 - in sandbox/webapps: src and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-01-17 10:34:10 -0500 (Thu, 17 Jan 2008)
New Revision: 394
Added:
sandbox/webapps/src/TestDispatch.java
Modified:
sandbox/webapps/myapp.xml
sandbox/webapps/src/TestSnoop.java
Log:
Add a test for Dispatcher and improve TestSnoop servlet.
Modified: sandbox/webapps/myapp.xml
===================================================================
--- sandbox/webapps/myapp.xml 2008-01-15 18:09:01 UTC (rev 393)
+++ sandbox/webapps/myapp.xml 2008-01-17 15:34:10 UTC (rev 394)
@@ -83,6 +83,10 @@
<servlet-name>TestSnoop</servlet-name>
<servlet-class>TestSnoop</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>TestDispatch</servlet-name>
+ <servlet-class>TestDispatch</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -141,6 +145,10 @@
<servlet-name>TestSnoop</servlet-name>
<url-pattern>/TestSnoop</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestDispatch</servlet-name>
+ <url-pattern>/TestDispatch</url-pattern>
+ </servlet-mapping>
<!-- Filter -->
<filter>
Added: sandbox/webapps/src/TestDispatch.java
===================================================================
--- sandbox/webapps/src/TestDispatch.java (rev 0)
+++ sandbox/webapps/src/TestDispatch.java 2008-01-17 15:34:10 UTC (rev 394)
@@ -0,0 +1,98 @@
+/*
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision: 420067 $, $Date: 2006-07-08 09:16:58 +0200 (sub, 08 srp 2006) $
+ */
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class for Servlet: TestServlet
+ *
+ */
+public class TestDispatch extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
+
+ protected void writeHead(HttpServletResponse response) throws ServletException, IOException {
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<body bgcolor=\"white\">");
+ out.println("<head>");
+
+ String title = "src/TestDispatch.java";
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body>");
+ out.println("<h3>" + title + "</h3>");
+ }
+
+ protected void writeRest(HttpServletResponse response, String string) throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ if (string != null) {
+ out.println(string);
+ }
+ out.println("</body>");
+ out.println("</html>");
+ }
+ protected void writeEx(HttpServletResponse response, Exception e) throws ServletException, IOException {
+ writeHead(response);
+ PrintWriter out = response.getWriter();
+ e.printStackTrace(out);
+ out.println("</body>");
+ out.println("</html>");
+ }
+
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+
+ ServletContext sc = getServletContext();
+ String context = request.getParameter("context");
+ String servlet = request.getParameter("servlet");
+
+ if (context == null || servlet == null) {
+ writeHead(response);
+ writeRest(response, "Please enter the context and the servlet: ?context=/php-examples&servlet=/index.php");
+ return;
+ }
+ ServletContext sc2 = sc.getContext(context);
+ RequestDispatcher rd = sc2.getRequestDispatcher(servlet);
+
+ try
+ {
+ rd.include(request, response);
+ response.flushBuffer();
+ }
+ catch (ServletException e)
+ {
+ writeEx(response, e);
+ }
+ catch (IOException e)
+ {
+ writeEx(response, e);
+ }
+ }
+}
Modified: sandbox/webapps/src/TestSnoop.java
===================================================================
--- sandbox/webapps/src/TestSnoop.java 2008-01-15 18:09:01 UTC (rev 393)
+++ sandbox/webapps/src/TestSnoop.java 2008-01-17 15:34:10 UTC (rev 394)
@@ -80,7 +80,14 @@
out.println("<P>");
System.out.println("name: " + name + " value: " + value);
}
+ out.println("<br>contextPath: " + request.getContextPath());
+ out.println("<br>servletPath: " + request.getServletPath());
+ out.println("<br>pathInfo: " + request.getPathInfo());
+ out.println("<br>RequestURI: " + request.getRequestURI());
+ out.println("<br>RequestURL: " + request.getRequestURL());
+ out.println("<br>QueryString: " + request.getQueryString());
+
}
public void doPost(HttpServletRequest request,
16 years, 11 months
JBossWeb SVN: r393 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-15 13:09:01 -0500 (Tue, 15 Jan 2008)
New Revision: 393
Modified:
trunk/java/org/apache/catalina/loader/WebappClassLoader.java
trunk/webapps/docs/changelog.xml
Log:
- Add system property to be able to avoid system CL delegation if needed.
Modified: trunk/java/org/apache/catalina/loader/WebappClassLoader.java
===================================================================
--- trunk/java/org/apache/catalina/loader/WebappClassLoader.java 2008-01-14 11:04:56 UTC (rev 392)
+++ trunk/java/org/apache/catalina/loader/WebappClassLoader.java 2008-01-15 18:09:01 UTC (rev 393)
@@ -112,6 +112,9 @@
public static final boolean ENABLE_CLEAR_REFERENCES =
Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES", "true")).booleanValue();
+ public static final boolean SYSTEM_CL_DELEGATION =
+ Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.SYSTEM_CL_DELEGATION", "true")).booleanValue();
+
protected class PrivilegedFindResource
implements PrivilegedAction {
@@ -1271,15 +1274,17 @@
// (0.2) Try loading the class with the system class loader, to prevent
// the webapp from overriding J2SE classes
- try {
- clazz = system.loadClass(name);
- if (clazz != null) {
- if (resolve)
- resolveClass(clazz);
- return (clazz);
+ if (SYSTEM_CL_DELEGATION) {
+ try {
+ clazz = system.loadClass(name);
+ if (clazz != null) {
+ if (resolve)
+ resolveClass(clazz);
+ return (clazz);
+ }
+ } catch (ClassNotFoundException e) {
+ // Ignore
}
- } catch (ClassNotFoundException e) {
- // Ignore
}
// (0.5) Permission to access this class when using a SecurityManager
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-01-14 11:04:56 UTC (rev 392)
+++ trunk/webapps/docs/changelog.xml 2008-01-15 18:09:01 UTC (rev 393)
@@ -128,6 +128,10 @@
<bug>43914</bug>: URLs in location headers should be encoded. Patch
provided by Ivan Todoroski. (markt)
</fix>
+ <fix>
+ Add org.apache.catalina.loader.WebappClassLoader.SYSTEM_CL_DELEGATION boolean system
+ property to avoid systematic system CL delegation if needed. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
16 years, 11 months
JBossWeb SVN: r392 - in trunk: conf and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-14 06:04:56 -0500 (Mon, 14 Jan 2008)
New Revision: 392
Modified:
trunk/build.properties.default
trunk/build.xml
trunk/conf/catalina.policy
Log:
- Update minor deps.
- JULI should use stricter permissions.
- Package JBoss Logging with bootstrap.jar (putting it inside JULI with its new permissions causes weird errors).
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2008-01-09 18:27:13 UTC (rev 391)
+++ trunk/build.properties.default 2008-01-14 11:04:56 UTC (rev 392)
@@ -31,7 +31,7 @@
base-tomcat.loc=http://archive.apache.org/dist/tomcat
# ----- Commons Logging, version 1.1 or later -----
-commons-logging-src.loc=${base-jakarta.loc}/commons/logging/source/commons-logging-1.1-src.tar.gz
+commons-logging-src.loc=${base-jakarta.loc}/commons/logging/source/commons-logging-1.1.1-src.tar.gz
# ----- Webservices -----
jaxrpc-src.loc=http://repo1.maven.org/maven2/geronimo-spec/geronimo-spec-...
@@ -65,12 +65,12 @@
commons-collections-src.loc=${base-jakarta.loc}/commons/collections/source/commons-collections-3.2-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.22
+nsis.home=${base.path}/nsis-2.34
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.22-setup.exe
+nsis.loc=${base-sf.loc}/nsis/nsis-2.34-setup.exe
# ----- Commons Daemon, version 1.0-Alpha or later -----
commons-daemon.home=${base.path}/commons-daemon-1.0.1
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-01-09 18:27:13 UTC (rev 391)
+++ trunk/build.xml 2008-01-14 11:04:56 UTC (rev 392)
@@ -182,6 +182,7 @@
<include name="org/apache/catalina/security/SecurityClassLoad.class" />
<include name="org/apache/naming/JndiPermission.class" />
<include name="org/apache/tomcat/util/compat/*" />
+ <include name="org/jboss/logging/**" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
@@ -192,7 +193,6 @@
<jar jarfile="${tomcat-juli.jar}">
<fileset dir="${tomcat.classes}">
<include name="org/apache/juli/**" />
- <include name="org/jboss/logging/**" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
Modified: trunk/conf/catalina.policy
===================================================================
--- trunk/conf/catalina.policy 2008-01-09 18:27:13 UTC (rev 391)
+++ trunk/conf/catalina.policy 2008-01-14 11:04:56 UTC (rev 392)
@@ -47,7 +47,19 @@
// These permissions apply to the logging API
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
- permission java.security.AllPermission;
+ permission java.util.PropertyPermission "java.util.logging.config.class", "read";
+ permission java.util.PropertyPermission "java.util.logging.config.file", "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";
+ permission java.util.logging.LoggingPermission "control";
+ permission java.io.FilePermission "${catalina.base}${file.separator}logs", "read, write";
+ permission java.io.FilePermission "${catalina.base}${file.separator}logs${file.separator}*", "read, write";
+ permission java.lang.RuntimePermission "getClassLoader";
+ // To enable per context logging configuration, permit read access to the appropriate file.
+ // Be sure that the logging configuration is secure before enabling such access
+ // eg for the examples web application:
+ // permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read";
};
// These permissions apply to the server startup code
16 years, 11 months
JBossWeb SVN: r391 - trunk/java/org/apache/catalina/security.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-09 13:27:13 -0500 (Wed, 09 Jan 2008)
New Revision: 391
Modified:
trunk/java/org/apache/catalina/security/SecurityClassLoad.java
Log:
- Removed anonymous class.
Modified: trunk/java/org/apache/catalina/security/SecurityClassLoad.java
===================================================================
--- trunk/java/org/apache/catalina/security/SecurityClassLoad.java 2008-01-09 14:54:52 UTC (rev 390)
+++ trunk/java/org/apache/catalina/security/SecurityClassLoad.java 2008-01-09 18:27:13 UTC (rev 391)
@@ -63,9 +63,6 @@
(basePackage +
"core.ContainerBase$PrivilegedAddChild");
loader.loadClass
- (basePackage +
- "core.StandardWrapper$1");
- loader.loadClass
(basePackage +
"core.ApplicationHttpRequest$AttributeNamesEnumerator");
}
16 years, 12 months
JBossWeb SVN: r390 - in trunk: res/confinstall and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-09 09:54:52 -0500 (Wed, 09 Jan 2008)
New Revision: 390
Modified:
trunk/conf/server.xml
trunk/res/confinstall/server_1.xml
Log:
- Improve the wording a bit.
Modified: trunk/conf/server.xml
===================================================================
--- trunk/conf/server.xml 2008-01-08 11:49:17 UTC (rev 389)
+++ trunk/conf/server.xml 2008-01-09 14:54:52 UTC (rev 390)
@@ -28,9 +28,9 @@
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
- Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
- APR (HTTP/AJP) Connector: /docs/apr.html
+ If APR is installed, additional Connector documentation: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
Modified: trunk/res/confinstall/server_1.xml
===================================================================
--- trunk/res/confinstall/server_1.xml 2008-01-08 11:49:17 UTC (rev 389)
+++ trunk/res/confinstall/server_1.xml 2008-01-09 14:54:52 UTC (rev 390)
@@ -42,9 +42,9 @@
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
- Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
- APR (HTTP/AJP) Connector: /docs/apr.html
+ If APR is installed, additional Connector documentation: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector
\ No newline at end of file
16 years, 12 months
JBossWeb SVN: r389 - in trunk: java/org/apache/jasper/compiler and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-08 06:49:17 -0500 (Tue, 08 Jan 2008)
New Revision: 389
Modified:
trunk/java/org/apache/catalina/core/AprLifecycleListener.java
trunk/java/org/apache/jasper/compiler/Parser.java
trunk/java/org/apache/tomcat/util/modeler/ManagedBean.java
trunk/webapps/docs/changelog.xml
Log:
- Nested tags handling.
- Fix some JMX features.
Modified: trunk/java/org/apache/catalina/core/AprLifecycleListener.java
===================================================================
--- trunk/java/org/apache/catalina/core/AprLifecycleListener.java 2008-01-04 17:21:51 UTC (rev 388)
+++ trunk/java/org/apache/catalina/core/AprLifecycleListener.java 2008-01-08 11:49:17 UTC (rev 389)
@@ -59,7 +59,7 @@
protected static final int TCN_REQUIRED_MAJOR = 1;
protected static final int TCN_REQUIRED_MINOR = 1;
protected static final int TCN_REQUIRED_PATCH = 8;
- protected static final int TCN_RECOMMENDED_PV = 10;
+ protected static final int TCN_RECOMMENDED_PV = 12;
// ---------------------------------------------- Properties
Modified: trunk/java/org/apache/jasper/compiler/Parser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Parser.java 2008-01-04 17:21:51 UTC (rev 388)
+++ trunk/java/org/apache/jasper/compiler/Parser.java 2008-01-08 11:49:17 UTC (rev 389)
@@ -422,6 +422,12 @@
if (ctxt.getOptions().isCaching()) {
ctxt.getOptions().getCache().put(uri, impl);
}
+ } else {
+ // Current compilation context needs location of cached
+ // tag files
+ for (TagFileInfo info : impl.getTagFiles()) {
+ ctxt.setTagFileJarUrl(info.getPath(), ctxt.getTagFileJarUrl());
+ }
}
pageInfo.addTaglib(uri, impl);
}
Modified: trunk/java/org/apache/tomcat/util/modeler/ManagedBean.java
===================================================================
--- trunk/java/org/apache/tomcat/util/modeler/ManagedBean.java 2008-01-04 17:21:51 UTC (rev 388)
+++ trunk/java/org/apache/tomcat/util/modeler/ManagedBean.java 2008-01-08 11:49:17 UTC (rev 389)
@@ -542,7 +542,7 @@
Object object = null;
NoSuchMethodException exception = null;
try {
- object = this;
+ object = bean;
m = object.getClass().getMethod(setMethod, signature);
} catch (NoSuchMethodException e) {
exception = e;;
@@ -601,7 +601,7 @@
Object object = null;
Exception exception = null;
try {
- object = this;
+ object = bean;
method = object.getClass().getMethod(aname, types);
} catch (NoSuchMethodException e) {
exception = e;
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-01-04 17:21:51 UTC (rev 388)
+++ trunk/webapps/docs/changelog.xml 2008-01-08 11:49:17 UTC (rev 389)
@@ -149,6 +149,9 @@
<fix>
No need to swallow input if there is an error. (remm)
</fix>
+ <fix>
+ <bug>43868</bug>: MBean methods getInvoke() and getSetter() were broken. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
@@ -178,6 +181,9 @@
<fix>
<bug>43758</bug>: Fix NPE with empty scripting elements. (markt)
</fix>
+ <fix>
+ <bug>43743</bug>: Correctly handle nest tag files packaged in a jar. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Webapps">
16 years, 12 months
JBossWeb SVN: r388 - in trunk/java/org/apache: coyote/http11 and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-04 12:21:51 -0500 (Fri, 04 Jan 2008)
New Revision: 388
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
- Change input to allow the internal filter chain to return that it read no bytes (this may happen in very
rare cases in non blocking with chunks). Also experimental, maybe some more changes are needed.
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-01-04 17:17:44 UTC (rev 387)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-01-04 17:21:51 UTC (rev 388)
@@ -164,8 +164,9 @@
request.getEvent().setEventType(CometEvent.EventType.ERROR);
request.getEvent().setEventSubType(CometEvent.EventSubType.CLIENT_DISCONNECT);
} else {
- request.getEvent().setEventType(CometEvent.EventType.END);
- request.getEvent().setEventSubType(null);
+ // Data was present on the socket, but it did not translate into actual
+ // entity body bytes
+ return true;
}
}
} else if (status == SocketStatus.OPEN_WRITE) {
Modified: trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-01-04 17:17:44 UTC (rev 387)
+++ trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-01-04 17:21:51 UTC (rev 388)
@@ -756,7 +756,7 @@
bbuf.limit(nRead);
bbuf.get(buf, pos, nRead);
lastValid = pos + nRead;
- } else {
+ } else if (nRead < 0) {
if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) {
throw new SocketTimeoutException(sm.getString("iib.failedread"));
} else {
Modified: trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2008-01-04 17:17:44 UTC (rev 387)
+++ trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2008-01-04 17:21:51 UTC (rev 388)
@@ -123,14 +123,14 @@
if (endChunk)
return -1;
- if(needCRLFParse) {
+ if (needCRLFParse) {
needCRLFParse = false;
parseCRLF();
}
if (remaining <= 0) {
if (!parseChunkHeader()) {
- throw new IOException("Invalid chunk header");
+ return 0;
}
if (endChunk) {
parseEndChunk();
@@ -263,6 +263,7 @@
while (!eol) {
if (pos >= lastValid) {
+ // In non blocking mode, no new chunk follows, even if data was present
if (readBytes() <= 0)
return false;
}
@@ -281,7 +282,7 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
- return false;
+ throw new IOException("Invalid chunk header");
}
}
@@ -289,15 +290,13 @@
}
- if (!readDigit)
- return false;
+ if (!readDigit || (result < 0))
+ throw new IOException("Invalid chunk header");
if (result == 0)
endChunk = true;
remaining = result;
- if (remaining < 0)
- return false;
return true;
17 years
JBossWeb SVN: r387 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-04 12:17:44 -0500 (Fri, 04 Jan 2008)
New Revision: 387
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/coyote/http11/Http11Processor.java
trunk/webapps/docs/changelog.xml
Log:
- No input swallowing when there's an error. It's quite experimental since this may cause delays or problems
when closing the socket.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-01-03 10:43:08 UTC (rev 386)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-01-04 17:17:44 UTC (rev 387)
@@ -924,6 +924,10 @@
}
// Finish the handling of the request
+ if (error) {
+ // If there is an unspecified error, the connection will be closed
+ inputBuffer.setSwallowInput(false);
+ }
if (!comet) {
endRequest();
}
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-01-03 10:43:08 UTC (rev 386)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-01-04 17:17:44 UTC (rev 387)
@@ -863,6 +863,10 @@
}
// Finish the handling of the request
+ if (error) {
+ // If there is an unspecified error, the connection will be closed
+ inputBuffer.setSwallowInput(false);
+ }
try {
rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
inputBuffer.endRequest();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-01-03 10:43:08 UTC (rev 386)
+++ trunk/webapps/docs/changelog.xml 2008-01-04 17:17:44 UTC (rev 387)
@@ -124,6 +124,10 @@
<bug>44084</bug>: JASSRealm was broken for application provided
Principals. Patch provided by Noah Levitt. (markt)
</fix>
+ <fix>
+ <bug>43914</bug>: URLs in location headers should be encoded. Patch
+ provided by Ivan Todoroski. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -142,6 +146,9 @@
<bug>43622</bug>: Don't overwrite the min compression size set by the
compression attribute with the default. (markt)
</fix>
+ <fix>
+ No need to swallow input if there is an error. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
17 years
JBossWeb SVN: r386 - trunk/java/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-01-03 05:43:08 -0500 (Thu, 03 Jan 2008)
New Revision: 386
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
Log:
- Redirect for / uses URL encoding.
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-01-02 10:32:36 UTC (rev 385)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-01-03 10:43:08 UTC (rev 386)
@@ -24,6 +24,7 @@
import org.apache.catalina.Globals;
import org.apache.catalina.Wrapper;
import org.apache.catalina.util.StringManager;
+import org.apache.catalina.util.URLEncoder;
import org.apache.comet.CometEvent;
import org.apache.coyote.ActionCode;
import org.apache.coyote.Adapter;
@@ -100,6 +101,28 @@
StringManager.getManager(Constants.Package);
+ /**
+ * Encoder for the Location URL in HTTP redirects.
+ */
+ protected static URLEncoder urlEncoder;
+
+
+ // ----------------------------------------------------- Static Initializer
+
+
+ /**
+ * The safe character set.
+ */
+ static {
+ urlEncoder = new URLEncoder();
+ urlEncoder.addSafeCharacter('-');
+ urlEncoder.addSafeCharacter('_');
+ urlEncoder.addSafeCharacter('.');
+ urlEncoder.addSafeCharacter('*');
+ urlEncoder.addSafeCharacter('/');
+ }
+
+
// -------------------------------------------------------- Adapter Methods
@@ -484,7 +507,7 @@
// Possible redirect
MessageBytes redirectPathMB = request.getMappingData().redirectPath;
if (!redirectPathMB.isNull()) {
- String redirectPath = redirectPathMB.toString();
+ String redirectPath = urlEncoder.encode(redirectPathMB.toString());
String query = request.getQueryString();
if (request.isRequestedSessionIdFromURL()) {
// This is not optimal, but as this is not very common, it
17 years