commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r331603 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java
Date Mon, 07 Nov 2005 21:42:26 GMT
Author: olegk
Date: Mon Nov  7 13:42:22 2005
New Revision: 331603

URL: http://svn.apache.org/viewcvs?rev=331603&view=rev
Log:
PR #37256 (MultipartEntity incorrectly computes unknown length)

Contributed by Oleg Kalnichevski
Reviewed by Michael Becke

Modified:
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java?rev=331603&r1=331602&r2=331603&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/Part.java
Mon Nov  7 13:42:22 2005
@@ -419,7 +419,11 @@
         for (int i = 0; i < parts.length; i++) {
             // set the part boundary before we calculate the part's length
             parts[i].setPartBoundary(partBoundary);
-            total += parts[i].length();
+            long l = parts[i].length();
+            if (l < 0) {
+                return -1;
+            }
+            total += l;
         }
         total += EXTRA_BYTES.length;
         total += partBoundary.length;



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message