applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp
branchRCL_3
changeset 9 2611c08ee28e
parent 8 fa2fd8b2d6cc
child 37 5f1cd966e0d9
--- a/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp	Mon Mar 15 12:42:40 2010 +0200
+++ b/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp	Wed Mar 31 22:32:15 2010 +0300
@@ -792,4 +792,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.  
+  }
+}