cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1104252 - /cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
Date Tue, 17 May 2011 13:53:47 GMT
Author: ffang
Date: Tue May 17 13:53:47 2011
New Revision: 1104252

URL: http://svn.apache.org/viewvc?rev=1104252&view=rev
Log:
[CXF-3504]ensure can't read MimeBodyPartInputStream after close it

Modified:
    cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java

Modified: cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java?rev=1104252&r1=1104251&r2=1104252&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
Tue May 17 13:53:47 2011
@@ -32,6 +32,8 @@ public class MimeBodyPartInputStream ext
     byte[] boundary;
     byte[] boundaryBuffer;
 
+    private boolean closed;
+
     public MimeBodyPartInputStream(PushbackInputStream inStreamParam, 
                                    byte[] boundaryParam,
                                    int pbsize) {
@@ -45,7 +47,7 @@ public class MimeBodyPartInputStream ext
         byte b[] = buf;
         int off = origOff;
         int len = origLen;
-        if (boundaryFound) {
+        if (boundaryFound || closed) {
             return -1;
         }
         if ((off < 0) || (off > b.length) || (len < 0) 
@@ -268,4 +270,8 @@ public class MimeBodyPartInputStream ext
         }
         return value;
     }
+    
+    public void close() throws IOException {
+        this.closed = true;
+    }
 }



Mime
View raw message