axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject cvs commit: ws-axis/c/tests/utils/monitor/org/apache/test MockServerThread.java
Date Tue, 09 Aug 2005 09:41:11 GMT
prestonf    2005/08/09 02:41:11

  Modified:    c/tests/utils/monitor/org/apache/test MockServerThread.java
  Log:
  Update to Monitor to remove and additional CR that may have been added to the chunked data
chunk when it was extracted from the repository. (There is a flag in the repository that will
not expand LF to CRLF and sometimes it is left on).
  
  Revision  Changes    Path
  1.13      +28 -0     ws-axis/c/tests/utils/monitor/org/apache/test/MockServerThread.java
  
  Index: MockServerThread.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/utils/monitor/org/apache/test/MockServerThread.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MockServerThread.java	5 Aug 2005 12:09:45 -0000	1.12
  +++ MockServerThread.java	9 Aug 2005 09:41:11 -0000	1.13
  @@ -471,6 +471,34 @@
                           }
                           else
                           {
  +                            // Check if the chunk data size is bigger than
  +                            // expected.  If it is, then count up the number
  +                            // of CR LF in the data chunk and iff this number
  +                            // matches the difference is actual and expected
  +                            // chunk size, then remove all CR within the data
  +                            // chunk.
  +                            if( iEoL - iIndex > 2)
  +                            {
  +                                int	iLFCount = 0;
  +                                int	iLF = 0;
  +                                
  +                                while( (iLF = sChunkDataBlock.indexOf( sLF, iLF) + 1) >
0)
  +                                {
  +                                    iLFCount++;
  +                                }
  +                                
  +                                if( iLFCount == (iEoL - iIndex - 2))
  +                                {
  +                                    System.out.println( "Warning - chunk data size is larger
than expected.  Additional CR may have been added to LF within data chunk.  Fixed.");
  +                                    
  +                                    sChunkDataBlock = sChunkDataBlock.replaceAll( sCRLF,
sLF);
  +                                }
  +                                else
  +                                {
  +                                    System.out.println( "Warning - chunk data size is larger
than expected.  Additional CR may have been added to LF within data chunk.  Unable to fix.");
  +                                }
  +                            }
  +                            
                               sLine = getResponseLine( sResponse, sCRLF, iIndex, iEoL);
   
                               sChunkDataBlock += sLine;
  
  
  

Mime
View raw message