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 pr...@apache.org on 2005/10/21 15:35:28 UTC

svn commit: r327175 - /webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp

Author: prestonf
Date: Fri Oct 21 06:35:25 2005
New Revision: 327175

URL: http://svn.apache.org/viewcvs?rev=327175&view=rev
Log:
Part of the fix for AXISCPP-859

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=327175&r1=327174&r2=327175&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Fri Oct 21 06:35:25 2005
@@ -1510,6 +1510,8 @@
 
 // Check if the message is chunked
 	int	iPosChunked = m_strReceived.find( ASCII_S_TRANSFERENCODING_CHUNKED);
+	int iHTTPStart = m_strReceived.find( ASCII_S_HTTP);
+	int iHTTPEnd = m_strReceived.find( ASCII_S_CRLFCRLF);
 
 	if( iPosChunked != std::string::npos)
 	{
@@ -1539,7 +1541,19 @@
 		if( (m_eProtocolType == APTHTTP1_0) || (m_eProtocolType == APTHTTP1_1) )
 		{
 			m_GetBytesState = eSOAPMessageIsNotChunked;
-			m_iContentLength = m_iBytesLeft;
+			m_iBytesLeft = m_strReceived.substr( iHTTPEnd + 2).length();
+
+// Check if all the message has already been recieved.  If not, then subtract
+// that bit that has been from the total length.  If so, then make the content
+// length equal to zero.
+			if( m_iContentLength >= m_iBytesLeft)
+			{
+				m_iContentLength -= m_iBytesLeft;
+			}
+			else
+			{
+				m_iContentLength = 0;
+			}
 		}
 		else
 		{
@@ -1549,9 +1563,6 @@
 										  "HTTP header message must be chunked or have a content length.");
 		}
 	}
-
-	int iHTTPStart = m_strReceived.find( ASCII_S_HTTP);
-	int iHTTPEnd = m_strReceived.find( ASCII_S_CRLFCRLF);
 
 // Extract HTTP header and process it
 	m_strResponseHTTPHeaders = m_strReceived.substr( iHTTPStart, iHTTPEnd + 2 - iHTTPStart);