JBossWeb SVN: r1365 - branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/src/share/classes/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-01-24 22:28:00 -0500 (Sun, 24 Jan 2010)
New Revision: 1365
Modified:
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/src/share/classes/org/apache/tomcat/util/http/Cookies.java
Log:
Fix to allow equals sign in version0 cookie values for [JBPAPP-3511].
Modified: branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/src/share/classes/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-01-25 01:24:48 UTC (rev 1364)
+++ branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-01-25 03:28:00 UTC (rev 1365)
@@ -46,6 +46,12 @@
MimeHeaders headers;
+ /**
+ * If true, cookie values are allowed to contain an equals character without
+ * being quoted.
+ */
+ public static final boolean ALLOW_EQUALS_IN_VALUE;
+
/*
List of Separator Characters (see isSeparator())
Excluding the '/' char violates the RFC, but
@@ -65,6 +71,10 @@
for (int i = 0; i < SEPARATORS.length; i++) {
separators[SEPARATORS[i]] = true;
}
+
+ ALLOW_EQUALS_IN_VALUE = Boolean.valueOf(System.getProperty(
+ "org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE",
+ "false")).booleanValue();
}
/**
@@ -367,7 +377,7 @@
// Get the cookie name. This must be a token
valueEnd = valueStart = nameStart = pos;
- pos = nameEnd = getTokenEndPosition(bytes,pos,end);
+ pos = nameEnd = getTokenEndPosition(bytes,pos,end,true);
// Skip whitespace
while (pos < end && isWhiteSpace(bytes[pos])) {pos++; };
@@ -414,12 +424,14 @@
// The position is OK (On a delimiter)
break;
default:;
- if (!isSeparator(bytes[pos])) {
+ if (!isSeparator(bytes[pos]) ||
+ bytes[pos] == '=' && ALLOW_EQUALS_IN_VALUE) {
// Token
valueStart=pos;
// getToken returns the position at the delimeter
// or other non-token character
- valueEnd=getTokenEndPosition(bytes, valueStart, end);
+ valueEnd = getTokenEndPosition(bytes, valueStart, end,
+ false);
// We need pos to advance
pos = valueEnd;
} else {
@@ -551,13 +563,26 @@
}
/**
+ * @deprecated - Use private method
+ * {@link #getTokenEndPosition(byte[], int, int, boolean)} instead
+ */
+ public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ return getTokenEndPosition(bytes, off, end, true);
+ }
+
+ /**
* Given the starting position of a token, this gets the end of the
* token, with no separator characters in between.
* JVK
*/
- public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ private static final int getTokenEndPosition(byte bytes[], int off, int end,
+ boolean isName) {
int pos = off;
- while (pos < end && !isSeparator(bytes[pos])) {pos++; };
+ while (pos < end &&
+ (!isSeparator(bytes[pos]) ||
+ bytes[pos]=='=' && ALLOW_EQUALS_IN_VALUE && !isName)) {
+ pos++;
+ }
if (pos > end)
return end;
14 years, 11 months
JBossWeb SVN: r1364 - branches.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-01-24 20:24:48 -0500 (Sun, 24 Jan 2010)
New Revision: 1364
Added:
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511/
Log:
Create JBPAPP-3511 patch branch from JBOSSWEB_2_0_0_GA_CP12 tag
Copied: branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-3511 (from rev 1363, tags/JBOSSWEB_2_0_0_GA_CP12)
14 years, 11 months
JBossWeb SVN: r1363 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-01-22 12:55:23 -0500 (Fri, 22 Jan 2010)
New Revision: 1363
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java
Log:
Allow equals sign in version0 cookie values for [JBPAPP-3510].
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-01-19 17:28:00 UTC (rev 1362)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-01-22 17:55:23 UTC (rev 1363)
@@ -46,6 +46,12 @@
MimeHeaders headers;
+ /**
+ * If true, cookie values are allowed to contain an equals character without
+ * being quoted.
+ */
+ public static final boolean ALLOW_EQUALS_IN_VALUE;
+
/*
List of Separator Characters (see isSeparator())
Excluding the '/' char violates the RFC, but
@@ -65,6 +71,10 @@
for (int i = 0; i < SEPARATORS.length; i++) {
separators[SEPARATORS[i]] = true;
}
+
+ ALLOW_EQUALS_IN_VALUE = Boolean.valueOf(System.getProperty(
+ "org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE",
+ "false")).booleanValue();
}
/**
@@ -367,7 +377,7 @@
// Get the cookie name. This must be a token
valueEnd = valueStart = nameStart = pos;
- pos = nameEnd = getTokenEndPosition(bytes,pos,end);
+ pos = nameEnd = getTokenEndPosition(bytes,pos,end,true);
// Skip whitespace
while (pos < end && isWhiteSpace(bytes[pos])) {pos++; };
@@ -414,12 +424,14 @@
// The position is OK (On a delimiter)
break;
default:;
- if (!isSeparator(bytes[pos])) {
+ if (!isSeparator(bytes[pos]) ||
+ bytes[pos] == '=' && ALLOW_EQUALS_IN_VALUE) {
// Token
valueStart=pos;
// getToken returns the position at the delimeter
// or other non-token character
- valueEnd=getTokenEndPosition(bytes, valueStart, end);
+ valueEnd = getTokenEndPosition(bytes, valueStart, end,
+ false);
// We need pos to advance
pos = valueEnd;
} else {
@@ -551,13 +563,26 @@
}
/**
+ * @deprecated - Use private method
+ * {@link #getTokenEndPosition(byte[], int, int, boolean)} instead
+ */
+ public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ return getTokenEndPosition(bytes, off, end, true);
+ }
+
+ /**
* Given the starting position of a token, this gets the end of the
* token, with no separator characters in between.
* JVK
*/
- public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ private static final int getTokenEndPosition(byte bytes[], int off, int end,
+ boolean isName) {
int pos = off;
- while (pos < end && !isSeparator(bytes[pos])) {pos++; };
+ while (pos < end &&
+ (!isSeparator(bytes[pos]) ||
+ bytes[pos]=='=' && ALLOW_EQUALS_IN_VALUE && !isName)) {
+ pos++;
+ }
if (pos > end)
return end;
14 years, 11 months
JBossWeb SVN: r1362 - trunk/java/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-19 12:28:00 -0500 (Tue, 19 Jan 2010)
New Revision: 1362
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
Log:
- Better method name ...
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-01-19 17:17:24 UTC (rev 1361)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-01-19 17:28:00 UTC (rev 1362)
@@ -672,7 +672,7 @@
request.setRequestedSessionCookie(true);
request.setRequestedSessionURL(false);
} else {
- if (!checkSessionIdValid(request, request.getRequestedSessionId())) {
+ if (!isSessionIdValid(request, request.getRequestedSessionId())) {
// Replace the session id until one is valid
convertMB(scookie.getValue());
request.setRequestedSessionId(scookie.getValue().toString());
@@ -688,7 +688,7 @@
* Return <code>true</code> if the session identifier specified
* identifies a valid session.
*/
- public boolean checkSessionIdValid(Request request, String id) {
+ public boolean isSessionIdValid(Request request, String id) {
if (id == null)
return (false);
Context context = request.getContext();
14 years, 11 months
JBossWeb SVN: r1361 - in trunk/java/org/apache/catalina: connector and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-19 12:17:24 -0500 (Tue, 19 Jan 2010)
New Revision: 1361
Modified:
trunk/java/org/apache/catalina/Session.java
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/catalina/session/StandardSession.java
Log:
- Avoid checking for session validity out of the webapp context, which would be a source
of problems. Instead, when more than one cookie is present, only check if there is a session object
and it is currently valid.
- Add direct access to the validity state of the session.
Modified: trunk/java/org/apache/catalina/Session.java
===================================================================
--- trunk/java/org/apache/catalina/Session.java 2010-01-15 14:43:28 UTC (rev 1360)
+++ trunk/java/org/apache/catalina/Session.java 2010-01-19 17:17:24 UTC (rev 1361)
@@ -222,6 +222,13 @@
public boolean isValid();
+ /**
+ * Return the <code>isValid</code> flag for this session without doing any
+ * validity check.
+ */
+ public boolean isValidInternal();
+
+
// --------------------------------------------------------- Public Methods
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-01-15 14:43:28 UTC (rev 1360)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-01-19 17:17:24 UTC (rev 1361)
@@ -54,6 +54,8 @@
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
+import org.apache.catalina.Manager;
+import org.apache.catalina.Session;
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request.AsyncListenerRegistration;
import org.apache.catalina.util.StringManager;
@@ -666,19 +668,14 @@
if (!request.isRequestedSessionIdFromCookie()) {
// Accept only the first session id cookie
convertMB(scookie.getValue());
- request.setRequestedSessionId
- (scookie.getValue().toString());
+ request.setRequestedSessionId(scookie.getValue().toString());
request.setRequestedSessionCookie(true);
request.setRequestedSessionURL(false);
- if (log.isDebugEnabled())
- log.debug(" Requested cookie session id is " +
- request.getRequestedSessionId());
} else {
- if (!request.isRequestedSessionIdValid()) {
+ if (!checkSessionIdValid(request, request.getRequestedSessionId())) {
// Replace the session id until one is valid
convertMB(scookie.getValue());
- request.setRequestedSessionId
- (scookie.getValue().toString());
+ request.setRequestedSessionId(scookie.getValue().toString());
}
}
}
@@ -686,7 +683,33 @@
}
+
+ /**
+ * Return <code>true</code> if the session identifier specified
+ * identifies a valid session.
+ */
+ public boolean checkSessionIdValid(Request request, String id) {
+ if (id == null)
+ return (false);
+ Context context = request.getContext();
+ if (context == null)
+ return (false);
+ Manager manager = context.getManager();
+ if (manager == null)
+ return (false);
+ Session session = null;
+ try {
+ session = manager.findSession(id);
+ } catch (IOException e) {
+ session = null;
+ }
+ if ((session != null) && session.isValidInternal())
+ return (true);
+ else
+ return (false);
+ }
+
/**
* Character conversion of the URI.
*/
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2010-01-15 14:43:28 UTC (rev 1360)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2010-01-19 17:17:24 UTC (rev 1361)
@@ -45,7 +45,6 @@
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
-import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
import org.apache.catalina.Manager;
@@ -1384,7 +1383,7 @@
* Return the <code>isValid</code> flag for this session without any expiration
* check.
*/
- protected boolean isValidInternal() {
+ public boolean isValidInternal() {
return (this.isValid || this.expiring);
}
14 years, 11 months
JBossWeb SVN: r1360 - trunk/java/org/apache/el.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-15 09:43:28 -0500 (Fri, 15 Jan 2010)
New Revision: 1360
Modified:
trunk/java/org/apache/el/MethodExpressionImpl.java
Log:
- Override the right method.
Modified: trunk/java/org/apache/el/MethodExpressionImpl.java
===================================================================
--- trunk/java/org/apache/el/MethodExpressionImpl.java 2010-01-15 12:44:23 UTC (rev 1359)
+++ trunk/java/org/apache/el/MethodExpressionImpl.java 2010-01-15 14:43:28 UTC (rev 1360)
@@ -312,7 +312,7 @@
return false;
}
- public boolean isParametersProvided() {
+ public boolean isParmetersProvided() {
return this.getNode().isParametersProvided();
}
14 years, 11 months
JBossWeb SVN: r1359 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-15 07:44:23 -0500 (Fri, 15 Jan 2010)
New Revision: 1359
Modified:
trunk/java/org/jboss/web/rewrite/TomcatResolver.java
trunk/webapps/docs/changelog.xml
Log:
- Fix NPE with HTTP/1.0.
Modified: trunk/java/org/jboss/web/rewrite/TomcatResolver.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/TomcatResolver.java 2010-01-15 00:03:28 UTC (rev 1358)
+++ trunk/java/org/jboss/web/rewrite/TomcatResolver.java 2010-01-15 12:44:23 UTC (rev 1359)
@@ -56,7 +56,7 @@
return request.getHeader("forwarded");
} else if (key.equals("HTTP_HOST")) {
String host = request.getHeader("host");
- int index = host.indexOf(':');
+ int index = (host != null) ? host.indexOf(':') : -1;
if (index != -1)
host = host.substring(0, index);
return host;
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-01-15 00:03:28 UTC (rev 1358)
+++ trunk/webapps/docs/changelog.xml 2010-01-15 12:44:23 UTC (rev 1359)
@@ -22,6 +22,9 @@
<fix>
<bug>48516</bug>: Possible NPE in JNDI realm. (markt)
</fix>
+ <fix>
+ <jira>157</jira>: NPE on host with HTTP/1.0, submitted by Markus Grieder. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
14 years, 11 months
JBossWeb SVN: r1358 - branches/2.1.x/java/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-14 19:03:28 -0500 (Thu, 14 Jan 2010)
New Revision: 1358
Modified:
branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
Log:
- Sync with latest cookie update.
Modified: branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2010-01-14 17:20:51 UTC (rev 1357)
+++ branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2010-01-15 00:03:28 UTC (rev 1358)
@@ -37,7 +37,7 @@
private static org.jboss.logging.Logger log=
org.jboss.logging.Logger.getLogger(Cookies.class );
-
+
// expected average number of cookies per request
public static final int INITIAL_SIZE=4;
ServerCookie scookies[]=new ServerCookie[INITIAL_SIZE];
@@ -46,15 +46,21 @@
MimeHeaders headers;
+ /**
+ * If true, cookie values are allowed to contain an equals character without
+ * being quoted.
+ */
+ public static final boolean ALLOW_EQUALS_IN_VALUE;
+
/*
List of Separator Characters (see isSeparator())
Excluding the '/' char violates the RFC, but
it looks like a lot of people put '/'
in unquoted values: '/': ; //47
- '\t':9 ' ':32 '\"':34 '\'':39 '(':40 ')':41 ',':44 ':':58 ';':59 '<':60
+ '\t':9 ' ':32 '\"':34 '(':40 ')':41 ',':44 ':':58 ';':59 '<':60
'=':61 '>':62 '?':63 '@':64 '[':91 '\\':92 ']':93 '{':123 '}':125
*/
- public static final char SEPARATORS[] = { '\t', ' ', '\"', '\'', '(', ')', ',',
+ public static final char SEPARATORS[] = { '\t', ' ', '\"', '(', ')', ',',
':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '{', '}' };
protected static final boolean separators[] = new boolean[128];
@@ -65,6 +71,10 @@
for (int i = 0; i < SEPARATORS.length; i++) {
separators[SEPARATORS[i]] = true;
}
+
+ ALLOW_EQUALS_IN_VALUE = Boolean.valueOf(System.getProperty(
+ "org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE",
+ "false")).booleanValue();
}
/**
@@ -367,7 +377,7 @@
// Get the cookie name. This must be a token
valueEnd = valueStart = nameStart = pos;
- pos = nameEnd = getTokenEndPosition(bytes,pos,end);
+ pos = nameEnd = getTokenEndPosition(bytes,pos,end,true);
// Skip whitespace
while (pos < end && isWhiteSpace(bytes[pos])) {pos++; };
@@ -414,12 +424,14 @@
// The position is OK (On a delimiter)
break;
default:;
- if (!isSeparator(bytes[pos])) {
+ if (!isSeparator(bytes[pos]) ||
+ bytes[pos] == '=' && ALLOW_EQUALS_IN_VALUE) {
// Token
valueStart=pos;
// getToken returns the position at the delimeter
// or other non-token character
- valueEnd=getTokenEndPosition(bytes, valueStart, end);
+ valueEnd = getTokenEndPosition(bytes, valueStart, end,
+ false);
// We need pos to advance
pos = valueEnd;
} else {
@@ -551,13 +563,26 @@
}
/**
+ * @deprecated - Use private method
+ * {@link #getTokenEndPosition(byte[], int, int, boolean)} instead
+ */
+ public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ return getTokenEndPosition(bytes, off, end, true);
+ }
+
+ /**
* Given the starting position of a token, this gets the end of the
* token, with no separator characters in between.
* JVK
*/
- public static final int getTokenEndPosition(byte bytes[], int off, int end){
+ private static final int getTokenEndPosition(byte bytes[], int off, int end,
+ boolean isName) {
int pos = off;
- while (pos < end && !isSeparator(bytes[pos])) {pos++; };
+ while (pos < end &&
+ (!isSeparator(bytes[pos]) ||
+ bytes[pos]=='=' && ALLOW_EQUALS_IN_VALUE && !isName)) {
+ pos++;
+ }
if (pos > end)
return end;
14 years, 11 months
JBossWeb SVN: r1357 - branches/2.1.x/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2010-01-14 12:20:51 -0500 (Thu, 14 Jan 2010)
New Revision: 1357
Modified:
branches/2.1.x/webapps/docs/changelog.xml
Log:
Add the changelog... for 2.1.7
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2010-01-14 17:04:53 UTC (rev 1356)
+++ branches/2.1.x/webapps/docs/changelog.xml 2010-01-14 17:20:51 UTC (rev 1357)
@@ -17,13 +17,30 @@
<body>
<section name="JBoss Web 2.1.7.GA (remm)">
+ <subsection name="General">
+ <changelog>
+ <update>
+ Add new PING method for mod_cluster. (jfclere)
+ </update>
+ </changelog>
+ </subsection>
<subsection name="Coyote">
<changelog>
<fix>
Fix incomplete write logic in APR. (jfclere)
</fix>
+ <fix> <jboss-jira>JBWEB-153</jboss-jira> <bug>43839</bug>
+ Parent context cookie overwriting URL encoded cookie. (markt/mmillson)
+ </fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix> <jboss-jira>JBWEB-155</jboss-jira> <bug>42643</bug>
+ Duplicate JSP function mapper variables (markt/mmillson)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 2.1.6.GA (remm)">
14 years, 11 months
JBossWeb SVN: r1356 - tags.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2010-01-14 12:04:53 -0500 (Thu, 14 Jan 2010)
New Revision: 1356
Added:
tags/JBOSSWEB_2_1_7_GA/
Log:
Fix JBWEB-153/6, apr write with ssl and ping for mod_cluster tests.
Copied: tags/JBOSSWEB_2_1_7_GA (from rev 1355, branches/2.1.x)
14 years, 11 months