JBossWeb SVN: r2622 - branches/7.5.x/src/main/java/org/apache/tomcat/websocket.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-08-26 03:41:16 -0400 (Wed, 26 Aug 2015)
New Revision: 2622
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java
Log:
BZ1242359: Allow custom codes.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2015-08-26 07:34:36 UTC (rev 2621)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2015-08-26 07:41:16 UTC (rev 2622)
@@ -84,7 +84,7 @@
static CloseCode getCloseCode(int code) {
if (code > 2999 && code < 5000) {
- return CloseCodes.NORMAL_CLOSURE;
+ return CloseCodes.getCloseCode(code);
}
switch (code) {
case 1000:
9 years, 4 months
JBossWeb SVN: r2621 - branches/7.5.x/src/main/java/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-08-26 03:34:36 -0400 (Wed, 26 Aug 2015)
New Revision: 2621
Modified:
branches/7.5.x/src/main/java/org/apache/catalina/connector/Request.java
Log:
BZ1246939: Fix issue uploading multiple files (with identical names).
Modified: branches/7.5.x/src/main/java/org/apache/catalina/connector/Request.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/connector/Request.java 2015-07-24 12:21:37 UTC (rev 2620)
+++ branches/7.5.x/src/main/java/org/apache/catalina/connector/Request.java 2015-08-26 07:34:36 UTC (rev 2621)
@@ -380,7 +380,7 @@
/**
* Parts associated with the request.
*/
- protected Map<String, Part> parts = null;
+ protected Collection<Part> parts = null;
/**
@@ -2936,7 +2936,7 @@
protected void parseMultipart()
throws IOException, ServletException {
- parts = Collections.emptyMap();
+ parts = Collections.emptyList();
if (context == null)
return;
@@ -2987,14 +2987,14 @@
upload.setFileSizeMax(config.getMaxFileSize());
upload.setSizeMax(config.getMaxRequestSize());
- parts = new HashMap<String, Part>();
+ parts = new ArrayList<Part>();
try {
for (FileItem fileItem : upload.parseRequest(getRequest())) {
if (fileItem.getName() == null) {
coyoteRequest.getParameters().addParameterValues
(fileItem.getFieldName(), new String[] {fileItem.getString()});
}
- parts.put(fileItem.getFieldName(), new StandardPart(fileItem, config));
+ parts.add(new StandardPart(fileItem, config));
}
} catch(FileSizeLimitExceededException e) {
throw MESSAGES.multipartProcessingFailed(e);
@@ -3300,7 +3300,15 @@
if (parts == null) {
parseMultipart();
}
- return parts.get(name);
+ Collection<Part> c = getParts();
+ Iterator<Part> iterator = c.iterator();
+ while (iterator.hasNext()) {
+ Part part = iterator.next();
+ if (name.equals(part.getName())) {
+ return part;
+ }
+ }
+ return null;
}
@@ -3308,7 +3316,7 @@
if (parts == null) {
parseMultipart();
}
- return parts.values();
+ return parts;
}
9 years, 4 months