jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1567314 - /jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Date Tue, 11 Feb 2014 19:28:41 GMT
Author: tripod
Date: Tue Feb 11 19:28:41 2014
New Revision: 1567314

URL: http://svn.apache.org/r1567314
Log:
JCR-3726 DavEx should not always use multipart POTS to bypass potential form-size restrictions

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=1567314&r1=1567313&r2=1567314&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Tue Feb 11 19:28:41 2014
@@ -594,17 +594,12 @@ public class RepositoryServiceImpl exten
                 }
             }
 
-            if (parts.isEmpty()) {
-                // only a diff part. no multipart required.
-                method.addParameter(PARAM_DIFF, buf.toString());
-            } else {
-                // other parts are present -> add the diff part
-                addPart(PARAM_DIFF, buf.toString());
-                // ... and create multipart-entity (and set it to method)
-                Part[] partArr = parts.toArray(new Part[parts.size()]);
-                RequestEntity entity = new MultipartRequestEntity(partArr, method.getParams());
-                method.setRequestEntity(entity);
-            }
+            // add the diff part - always do multipart in case the receiving servlet
+            // engine has a form-size restriction (JCR-3726)
+            addPart(PARAM_DIFF, buf.toString());
+            Part[] partArr = parts.toArray(new Part[parts.size()]);
+            RequestEntity entity = new MultipartRequestEntity(partArr, method.getParams());
+            method.setRequestEntity(entity);
 
             HttpClient client = getClient(sessionInfo);
             try {
@@ -626,11 +621,9 @@ public class RepositoryServiceImpl exten
             method = null;
             isConsumed = true;
             // discard binary parts (JCR-2582)
-            if (parts != null) {
-                for (Part part : parts) {
-                    if (part instanceof BinaryPart) {
-                        ((BinaryPart) part).dispose();
-                    }
+            for (Part part : parts) {
+                if (part instanceof BinaryPart) {
+                    ((BinaryPart) part).dispose();
                 }
             }
         }



Mime
View raw message