applayerprotocols/httpservice/test/httpservicetest/ctestserverstreammanager.cpp
branchRCL_3
changeset 5 337070b4fa18
parent 0 b16258d2340f
child 12 f21293830889
--- a/applayerprotocols/httpservice/test/httpservicetest/ctestserverstreammanager.cpp	Fri Feb 19 23:50:57 2010 +0200
+++ b/applayerprotocols/httpservice/test/httpservicetest/ctestserverstreammanager.cpp	Fri Mar 12 15:45:46 2010 +0200
@@ -18,6 +18,7 @@
 #include <moutputstream.h>
 #include "httptestutils.h"
 #include "chttpclienttestparams.h"
+#include <escapeutils.h>
 
 const TUint KCarriageReturn = '\r';
 const TUint KLineFeed       = '\n';
@@ -68,19 +69,27 @@
 	    }
 	else
 	    {
-	    // Check to see if the buffer needs to grow
-        TInt maxLength  = iRequestStream->Des().MaxLength();
-        TInt reqdLength = iRequestStream->Length() + aBuffer.Length();
-	    if (reqdLength > maxLength)
+	    if(aBuffer.CompareF(iCurrentTestParam->EncodedAuthenticationRequest()) != 0)
 	        {
-	        HBufC8* largerBuffer = iRequestStream->ReAllocL(maxLength + aBuffer.Length());
-
-	        // Switch buffers. The old one was removed by ReAlloc.
-	        iRequestStream = largerBuffer;
+            // Check to see if the buffer needs to grow
+            TInt maxLength  = iRequestStream->Des().MaxLength();
+            TInt reqdLength = iRequestStream->Length() + aBuffer.Length();
+            if (reqdLength > maxLength)
+                {
+                HBufC8* largerBuffer = iRequestStream->ReAllocL(maxLength + aBuffer.Length());
+    
+                // Switch buffers. The old one was removed by ReAlloc.
+                iRequestStream = largerBuffer;
+                }
+    
+            // Can now append confidently
+            iRequestStream->Des().Append(aBuffer);   
+            }
+	    else
+	        {
+	        iRequestStream = aBuffer.AllocL();
+	      	iCurrentTestParam->SetAuthReqRes();
 	        }
-
-	    // Can now append confidently
-	    iRequestStream->Des().Append(aBuffer);
 	    }
 	   iInputStream->ReceivedDataRes();	    
 	ProcessRequestStreamL();