axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r380098 - /webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
Date Thu, 23 Feb 2006 11:37:48 GMT
Author: prestonf
Date: Thu Feb 23 03:37:40 2006
New Revision: 380098

URL: http://svn.apache.org/viewcvs?rev=380098&view=rev
Log:
Added code to remove any whitespace characters from in front of the ChunkSize value.

Modified:
    webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp?rev=380098&r1=380097&r2=380098&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Thu Feb 23 03:37:40 2006
@@ -1050,32 +1050,39 @@
 
 /* axtoi( Hex) Is a private method to convert an ascii hex string to an integer.
  */
-int axtoi( char *pcHexStg)
+int axtoi( char *pcHexStringIn)
 {
     int		iN = 0;			// position in string
     int		iM = 0;			// position in digit[] to shift
     int		iCount;			// loop index
     int		intValue = 0;	// integer value of hex string
     int		iDigit[32];		// hold values to convert
+	char *	pcHexString = pcHexStringIn;
+
+	// Remove and whitespace characters from string before processing.
+	while( *pcHexString == ' ' || *pcHexString == '\r' || *pcHexString == '\n' || *pcHexString
== '\t') 
+	{
+		pcHexString++;
+	}
 
     while( iN < 32)
     {
-		if( pcHexStg[iN] == '\0')
+		if( pcHexString[iN] == '\0')
 		{
 			break;
 		}
 	
-		if( pcHexStg[iN] >= ASCII_C_ZERO && 
-			pcHexStg[iN] <= ASCII_C_NINE)
+		if( pcHexString[iN] >= ASCII_C_ZERO && 
+			pcHexString[iN] <= ASCII_C_NINE)
 		{
-			iDigit[iN] = pcHexStg[iN] & 0x0f;	//convert to int
+			iDigit[iN] = pcHexString[iN] & 0x0f;	//convert to int
 		}
-		else if ((pcHexStg[iN] >= ASCII_C_LOWERCASEA && 
-		          pcHexStg[iN] <= ASCII_C_LOWERCASEF) ||
-		         (pcHexStg[iN] >= ASCII_C_UPPERCASEA && 
-		          pcHexStg[iN] <= ASCII_C_UPPERCASEF))
+		else if ((pcHexString[iN] >= ASCII_C_LOWERCASEA && 
+		          pcHexString[iN] <= ASCII_C_LOWERCASEF) ||
+		         (pcHexString[iN] >= ASCII_C_UPPERCASEA && 
+		          pcHexString[iN] <= ASCII_C_UPPERCASEF))
 		{
-			iDigit[iN] = (pcHexStg[iN] & 0x0f) + 9;	//convert to int
+			iDigit[iN] = (pcHexString[iN] & 0x0f) + 9;	//convert to int
 		}
 		else
 		{



Mime
View raw message