axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdinap...@apache.org
Subject svn commit: r307076 - /webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
Date Fri, 07 Oct 2005 10:16:56 GMT
Author: cdinapala
Date: Fri Oct  7 03:16:46 2005
New Revision: 307076

URL: http://svn.apache.org/viewcvs?rev=307076&view=rev
Log:
Add the line if (m_iBytesLeft == 0) to he getBytes () method in HTTPTransport.cpp.
(AXISCPP-827)

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=307076&r1=307075&r2=307076&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Fri Oct  7 03:16:46 2005
@@ -487,127 +487,131 @@
 //   eSOAPMessageIsNotChunked - The message is read until the number of message
 //                              bytes read equals the HTTP header content
 //                              length value.
-	switch( m_GetBytesState)
+	if (m_iBytesLeft == 0)
 	{
-		case eWaitingForHTTPHeader:
+		switch( m_GetBytesState)
 		{
-// Wait for a HTTP header to be located on the input stream.
-			do
-			{
-// From the input stream, wait for a 'valid' HTTP header.
-				readHTTPHeader();
+			case eWaitingForHTTPHeader:
+				{
+		// Wait for a HTTP header to be located on the input stream.
+					do
+					{
+		// From the input stream, wait for a 'valid' HTTP header.
+						readHTTPHeader();
 
-// From the header,extract such things as chunking, message length, etc.
-				processHTTPHeader();
+		// From the header,extract such things as chunking, message length, etc.
+						processHTTPHeader();
 
-			} while( m_iResponseHTTPStatusCode == 100);
+					} while( m_iResponseHTTPStatusCode == 100);
 
-// Check that the HTTP status code is valid.
-			checkHTTPStatusCode();
+		// Check that the HTTP status code is valid.
+					checkHTTPStatusCode();
 
-// Done with HTTP headers, get SOAP message.
-			int iHTTPStart = m_strReceived.find( ASCII_S_HTTP);
-			int iHTTPEnd = m_strReceived.find( ASCII_S_CRLFCRLF, iHTTPStart);
+		// Done with HTTP headers, get SOAP message.
+					int iHTTPStart = m_strReceived.find( ASCII_S_HTTP);
+					int iHTTPEnd = m_strReceived.find( ASCII_S_CRLFCRLF, iHTTPStart);
 
-			m_strReceived = m_strReceived.substr( iHTTPEnd + strlen( ASCII_S_CRLFCRLF));
+					m_strReceived = m_strReceived.substr( iHTTPEnd + strlen( ASCII_S_CRLFCRLF));
 
-			m_iBytesLeft = m_strReceived.length();
+					m_iBytesLeft = m_strReceived.length();
 
-// This bit of code should not be necessary, but just in case...
-			if( m_GetBytesState == eWaitingForHTTPHeader)
-			{
-				break;
-			}
-		}
+		// This bit of code should not be necessary, but just in case...
+					if( m_GetBytesState == eWaitingForHTTPHeader)
+					{
+						break;
+					}
+				}
 
-// At this point it is assumed that m_strReceived contains the block of
-// unprocessed data.  m_iBytesLeft is the length of text/data in m_strReceived
-// is a 'char *' type copy of the m_strReceived string.
-// NB: It is assumed that all of these variables ARE in sync at this point.
-	case eSOAPMessageIsChunked:
-		{
-			if( m_GetBytesState == eSOAPMessageIsChunked)
-			{
-				if( m_iBytesLeft == 0)
+		// At this point it is assumed that m_strReceived contains the block of
+		// unprocessed data.  m_iBytesLeft is the length of text/data in m_strReceived
+		// is a 'char *' type copy of the m_strReceived string.
+		// NB: It is assumed that all of these variables ARE in sync at this point.
+			case eSOAPMessageIsChunked:
 				{
-					getNextDataPacket( "No data available for next chunk size.");
-				}
+					if( m_GetBytesState == eSOAPMessageIsChunked)
+					{
+						if( m_iBytesLeft == 0)
+						{
+							getNextDataPacket( "No data available for next chunk size.");
+						}
+
+						m_iContentLength = getChunkSize();
+
+		// If the chunk size is larger than the available data, then read in more data
+		// until all of the chunk has been read.
+						while( m_iContentLength > m_iBytesLeft)
+						{
+							getNextDataPacket( "No data available for next chunk.");
+						}
+
+		// If data read is longer than chunk size, then copy the extra data to a
+		// temporary variable and process data just belonging to this chunk.
+						if( m_iBytesLeft > m_iContentLength)
+						{
+							nextChunk = m_strReceived.substr( m_iContentLength + strlen( ASCII_S_CRLF));
+							m_strReceived = m_strReceived.substr( 0, m_iContentLength);
+							m_iBytesLeft = m_iContentLength;
+
+		// Check to see if the next chunk size is zero.  If it is then change the state.
+							if( peekChunkLength( nextChunk) == 0)
+							{
+								m_GetBytesState = eWaitingForHTTPHeader;
+							}
+						}
+						else
+						{
+							nextChunk = "";
+						}
+
+		// Now have at least chunk size worth of data.  The chunk may contain Mime data
+		// (this depends on information in the HTTP header).  If Mime data is expected,
+		// process it first.
+						if( m_bMimeTrue)
+						{
+							processRootMimeBody();
 
-				m_iContentLength = getChunkSize();
+							m_iBytesLeft = m_strReceived.length();
+						}
 
-// If the chunk size is larger than the available data, then read in more data
-// until all of the chunk has been read.
-				while( m_iContentLength > m_iBytesLeft)
-				{
-					getNextDataPacket( "No data available for next chunk.");
+						break;
+					}
 				}
 
-// If data read is longer than chunk size, then copy the extra data to a
-// temporary variable and process data just belonging to this chunk.
-				if( m_iBytesLeft > m_iContentLength)
+			case eSOAPMessageIsNotChunked:
 				{
-					nextChunk = m_strReceived.substr( m_iContentLength + strlen( ASCII_S_CRLF));
-					m_strReceived = m_strReceived.substr( 0, m_iContentLength);
-					m_iBytesLeft = m_iContentLength;
+		// Check that there is more message to read.
+					if( m_iContentLength > 0)
+					{
+						getNextDataPacket( "No data available for message.");
 
-// Check to see if the next chunk size is zero.  If it is then change the state.
-					if( peekChunkLength( nextChunk) == 0)
+		// Check for Mime header
+						if( m_bMimeTrue)
+						{
+							processRootMimeBody();
+
+							m_iBytesLeft = m_strReceived.length();
+						}
+
+		// Subtract message length (so far) from expcted content length.
+						m_iContentLength -= m_iBytesLeft;
+
+		// If all of the message has been received, then reset the process state.
+						if( m_iContentLength <= 0)
+						{
+							m_GetBytesState = eWaitingForHTTPHeader;
+						}
+					}
+					else
 					{
+		// Reset the process state.
 						m_GetBytesState = eWaitingForHTTPHeader;
 					}
-				}
-				else
-				{
-					nextChunk = "";
-				}
 
-// Now have at least chunk size worth of data.  The chunk may contain Mime data
-// (this depends on information in the HTTP header).  If Mime data is expected,
-// process it first.
-				if( m_bMimeTrue)
-				{
-					processRootMimeBody();
-
-					m_iBytesLeft = m_strReceived.length();
+					break;
 				}
-
-				break;
-			}
-		}
-
-	case eSOAPMessageIsNotChunked:
-		{
-// Check that there is more message to read.
-			if( m_iContentLength > 0)
-			{
-				getNextDataPacket( "No data available for message.");
-
-// Check for Mime header
-				if( m_bMimeTrue)
-				{
-					processRootMimeBody();
-
-					m_iBytesLeft = m_strReceived.length();
-				}
-
-// Subtract message length (so far) from expcted content length.
-				m_iContentLength -= m_iBytesLeft;
-
-// If all of the message has been received, then reset the process state.
-				if( m_iContentLength <= 0)
-				{
-					m_GetBytesState = eWaitingForHTTPHeader;
-				}
-			}
-			else
-			{
-// Reset the process state.
-				m_GetBytesState = eWaitingForHTTPHeader;
-			}
-
-			break;
 		}
 	}
+
 
 // Copy as much of the message to the parser buffer as possible.
 	if( copyDataToParserBuffer( pcBuffer, piSize, m_iBytesLeft))



Mime
View raw message