Author: alessio.soldano(a)jboss.com
Date: 2009-02-20 10:11:13 -0500 (Fri, 20 Feb 2009)
New Revision: 9339
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
Log:
[JBWS-2195] Applying patch
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java 2009-02-20
12:26:53 UTC (rev 9338)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java 2009-02-20
15:11:13 UTC (rev 9339)
@@ -58,6 +58,8 @@
private boolean bufferingCompleted;
+ private boolean checkLeadingCRLF;
+
/**
* Constructs a <code>BoundaryDelimitedInputStream</code> using the
passed
* <code>InputStream</code> as the source for the outer stream.
@@ -71,6 +73,7 @@
source = in;
this.boundary = (byte[]) boundary.clone();
boyerMoore = new SimpleBoyerMoore(this.boundary);
+ checkLeadingCRLF = boundary.length > 0 && boundary[0] != '\r';
}
/*
@@ -201,6 +204,13 @@
}
else
{
+ if (checkLeadingCRLF && boundaryPosition > 1)
+ {
+ if (buffer[boundaryPosition - 1] == '\n' &&
buffer[boundaryPosition - 2] == '\r')
+ {
+ boundaryPosition -= 2;
+ }
+ }
returnLength = boundaryPosition;
createLeftOvers(buffer, returnLength + boundary.length, position);
Show replies by date