JBossWeb SVN: r1909 - branches.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2012-01-03 16:44:59 -0500 (Tue, 03 Jan 2012)
New Revision: 1909
Added:
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/
Log:
[JBPAPP-7836] one off patch branch
13 years
JBossWeb SVN: r1908 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-03 09:19:33 -0500 (Tue, 03 Jan 2012)
New Revision: 1908
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Parameters.java
Log:
JBWEB-220: Add missing max parameters check.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Parameters.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2012-01-02 17:49:10 UTC (rev 1907)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2012-01-03 14:19:33 UTC (rev 1908)
@@ -320,6 +320,8 @@
}
values[oldValues.length] = value;
} else {
+ if (paramHashStringArray.size() >=MAX_COUNT)
+ throw new IllegalStateException("Parameter count exceeded allowed maximum: " + MAX_COUNT);
values = new String[1];
values[0] = value;
}
13 years
JBossWeb SVN: r1907 - in trunk: java/org/apache/catalina/session and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-02 12:49:10 -0500 (Mon, 02 Jan 2012)
New Revision: 1907
Modified:
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/session/StandardSession.java
trunk/webapps/docs/changelog.xml
Log:
Two Servlet 3.0a updates.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2012-01-02 13:46:14 UTC (rev 1906)
+++ trunk/java/org/apache/catalina/connector/Request.java 2012-01-02 17:49:10 UTC (rev 1907)
@@ -2962,10 +2962,20 @@
if (!("multipart/form-data".equals(contentType)))
throw new ServletException(sm.getString("coyoteRequest.notMultipart"));
+ File location = null;
+ if (config.getLocation() == null || config.getLocation().length() == 0) {
+ location = ((File) context.getServletContext().getAttribute(
+ ServletContext.TEMPDIR));
+ } else {
+ location = new File(config.getLocation());
+ if (!location.isAbsolute()) {
+ location = new File((File) context.getServletContext().getAttribute(ServletContext.TEMPDIR),
+ config.getLocation()).getAbsoluteFile();
+ }
+ }
+
DiskFileItemFactory factory = new DiskFileItemFactory();
- if (config.getLocation() != null) {
- factory.setRepository(new File(config.getLocation()));
- }
+ factory.setRepository(location);
if (config.getFileSizeThreshold() > 0) {
factory.setSizeThreshold(config.getFileSizeThreshold());
}
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2012-01-02 13:46:14 UTC (rev 1906)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2012-01-02 17:49:10 UTC (rev 1907)
@@ -493,9 +493,6 @@
public void setMaxInactiveInterval(int interval) {
this.maxInactiveInterval = interval;
- if (isValid && interval == 0) {
- expire();
- }
}
@@ -581,7 +578,7 @@
return true;
}
- if (maxInactiveInterval >= 0) {
+ if (maxInactiveInterval > 0) {
int offset = (int) (System.currentTimeMillis() - creationTime);
int timeIdle = (offset - thisAccessedTime) / 1000;
if (timeIdle >= maxInactiveInterval) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-01-02 13:46:14 UTC (rev 1906)
+++ trunk/webapps/docs/changelog.xml 2012-01-02 17:49:10 UTC (rev 1907)
@@ -16,6 +16,16 @@
<body>
+<section name="JBoss Web 7.0.8.Final (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ Updates for Servlet 3.0a. (markt, remm)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 7.0.7.Final (remm)">
<subsection name="Catalina">
<changelog>
13 years
JBossWeb SVN: r1906 - branches/2.1.x/java/org/jboss/web/cluster/advertise.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2012-01-02 08:46:14 -0500 (Mon, 02 Jan 2012)
New Revision: 1906
Modified:
branches/2.1.x/java/org/jboss/web/cluster/advertise/AdvertiseListener.java
Log:
Arrange digest logic.
Modified: branches/2.1.x/java/org/jboss/web/cluster/advertise/AdvertiseListener.java
===================================================================
--- branches/2.1.x/java/org/jboss/web/cluster/advertise/AdvertiseListener.java 2011-12-22 14:19:32 UTC (rev 1905)
+++ branches/2.1.x/java/org/jboss/web/cluster/advertise/AdvertiseListener.java 2012-01-02 13:46:14 UTC (rev 1906)
@@ -286,20 +286,38 @@
}
}
- private boolean verifyDigest(String digest, String server, String date)
+ private boolean verifyDigest(String digest, String server, String date, String sequence)
{
if (md == null)
return true;
md.reset();
digestString(md, securityKey);
+ byte[] ssalt = md.digest();
+ md.update(ssalt);
+
digestString(md, date);
+ digestString(md, sequence);
digestString(md, server);
byte [] our = md.digest();
- byte [] dst = new byte[digest.length() * 2];
- for (int i = 0, j = 0; i < digest.length(); i++) {
- char ch = digest.charAt(i);
- dst[j++] = (byte)((ch >= 'A') ? ((ch & 0xdf) - 'A') + 10 : (ch - '0'));
+
+ if (our.length != digest.length() / 2) {
+ return false;
}
+
+ int val = 0;
+ for (int i = 0; i < digest.length(); i++) {
+ int ch = digest.charAt(i);
+ if (i % 2 == 0) {
+ val = ((ch >= 'A') ? ((ch & 0xdf) - 'A') + 10 : (ch - '0'));
+ } else {
+ val = val * 16 + ((ch >= 'A') ? ((ch & 0xdf) - 'A') + 10 : (ch - '0'));
+
+ if (our[i / 2] != (byte) val) {
+ return false;
+ }
+ }
+ }
+
return true;
}
@@ -367,6 +385,7 @@
String status_desc = null;
String digest = null;
String server_name = null;
+ String sequence = null;
AdvertisedServer server = null;
boolean added = false;
for (int i = 0; i < headers.length; i++) {
@@ -394,6 +413,9 @@
else if (hdrv[0].equals("Digest")) {
digest = hdrv[1];
}
+ else if (hdrv[0].equals("Sequence")) {
+ sequence = hdrv[1];
+ }
else if (hdrv[0].equals("Server")) {
server_name = hdrv[1];
server = servers.get(server_name);
@@ -410,8 +432,7 @@
if (server != null && status > 0) {
if (md != null) {
/* We need a digest to match */
- if (!verifyDigest(digest, server_name, date_str)) {
- System.out.println("Digest mismatch");
+ if (!verifyDigest(digest, server_name, date_str, sequence)) {
continue;
}
}
13 years