applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp
changeset 14 ce2bfba3d005
parent 12 88a7990e456a
child 49 b91bcc4b38e4
--- a/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp	Fri Apr 16 15:30:47 2010 +0300
+++ b/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp	Mon May 03 13:00:48 2010 +0300
@@ -793,4 +793,18 @@
 	User::Invariant();
 	}
 
-
+void CHttpResponseParser::FlushBodyDataIfNotRead()
+{
+ // Message is completed but the client is not yet read the complete body data
+ // and we are cancelling. So we need to clear the parsed body data as another 
+ // request would have been sent via the connection. The flushing of the body
+ // data is needed to make the connection manager to read further response from the
+ // socket otherwise it hangs. See the error: 
+ 
+ // Note: This function should be called from CancelTransactionHook and only in the
+ // case of client cancelling the transaction. ie; using RHTTPTransaction::Cancel();
+ if(MessageComplete() && iBodyParts.Count() > 0)
+  {
+  iBodyParts.Reset(); // Reset the body array.  
+  }
+}