You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/07/12 16:04:40 UTC

cvs commit: ws-axis/java/src/org/apache/axis/attachments DimeBodyPart.java

dims        2005/07/12 07:04:40

  Modified:    java/src/org/apache/axis/attachments DimeBodyPart.java
  Log:
  Fix for AXIS-2084 - Dime attachements: Type_Length of the final record chunk must be zero
  
  Revision  Changes    Path
  1.28      +5 -3      ws-axis/java/src/org/apache/axis/attachments/DimeBodyPart.java
  
  Index: DimeBodyPart.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/attachments/DimeBodyPart.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DimeBodyPart.java	24 Apr 2005 02:17:41 -0000	1.27
  +++ DimeBodyPart.java	12 Jul 2005 14:04:40 -0000	1.28
  @@ -335,23 +335,25 @@
                   return;
       		}
       		
  +            byte chunknext = 0; 
       		do {
       			bytesRead2 = in.read(buffer2);
       			
       			if(bytesRead2 < 0) {
       				//last record...do not set the chunk bit.
       				//buffer1 contains the last chunked record!
  -    				sendChunk(os, position, buffer1, 0, bytesRead1, (byte)0);
  +    				sendChunk(os, position, buffer1, 0, bytesRead1, chunknext);
       				break;
       			}
       			
  -    			sendChunk(os, position, buffer1, 0, bytesRead1, CHUNK);
  +    			sendChunk(os, position, buffer1, 0, bytesRead1, (byte)(CHUNK | chunknext));
  +                chunknext = CHUNK_NEXT; 
   
       			//now that we have written out buffer1, copy buffer2 into to buffer1
       			System.arraycopy(buffer2,0,buffer1,0,myChunkSize);
       			bytesRead1 = bytesRead2;
       			
  -    		}while(bytesRead2 > 0);
  +    		} while(bytesRead2 > 0);
       }
   
       protected void sendChunk(java.io.OutputStream os,