applayerprotocols/httptransportfw/Test/T_HttpPipeliningTest/CTestServerStreamManager.cpp
branchRCL_3
changeset 3 5ee1d9ce5878
parent 0 b16258d2340f
child 19 c0c2f28ace9c
equal deleted inserted replaced
0:b16258d2340f 3:5ee1d9ce5878
   181 
   181 
   182 TBool CTestServerStreamManager::ProcessRequestL()
   182 TBool CTestServerStreamManager::ProcessRequestL()
   183 	{
   183 	{
   184 	TBool processingRequest = ETrue;
   184 	TBool processingRequest = ETrue;
   185 	TInt currentBatch = 0;
   185 	TInt currentBatch = 0;
       
   186 	_LIT(KDefectTitle, "Defect Fix CDEF143497");
       
   187    while((iTestCase->TestCaseName().Match(KDefectTitle) == 0) && (processingRequest && (iCurrentTrans <= iTransCount)) && (currentBatch<KResponseBatchSize))
       
   188     	{
       
   189     	// Do we have enough data to respond to the current transaction?
       
   190 		TPtrC8 rawRequest = iTestCase->GetRawRequest(iConnectionIndex, iCurrentTrans);
       
   191 		TInt requestLength = rawRequest.Length();
       
   192 		TPtrC8 dataWindow = iDataStore->Mid(iDataPos);        
       
   193         // Prepare the response data to send
       
   194         iDataPos += requestLength;
       
   195         processingRequest = ETrue;
       
   196         TPtrC8 rawResponse = iTestCase->GetRawResponse(iConnectionIndex, iCurrentTrans);
       
   197         if(iDataToSend==NULL)
       
   198         iDataToSend = rawResponse.AllocL();
       
   199         else
       
   200         {
       
   201         TInt responseLength = rawResponse.Length();
       
   202         iDataToSend = iDataToSend->ReAllocL( (iDataToSend->Length()) + responseLength );
       
   203         TPtr8 buffer = iDataToSend->Des();
       
   204         buffer.Append(rawResponse);
       
   205         }
       
   206         // Check for a Connection: Close in the request
       
   207         iCloseConnection = IsConnectionCloseInData(rawRequest, rawResponse);
       
   208         if(iCloseConnection)
       
   209         processingRequest = EFalse;
       
   210         ++iCurrentTrans;
       
   211         ++currentBatch;
       
   212         if( processingRequest && currentBatch==KResponseBatchSize)
       
   213             iMoreResponseBatches = ETrue;
       
   214         else
       
   215             iMoreResponseBatches = EFalse;
       
   216 		if(iDataToSend!=NULL)
       
   217 		return ETrue;
       
   218 
       
   219 		return EFalse;            
       
   220 		} 
   186 	while( (processingRequest && (iCurrentTrans < iTransCount)) && (currentBatch<KResponseBatchSize) )
   221 	while( (processingRequest && (iCurrentTrans < iTransCount)) && (currentBatch<KResponseBatchSize) )
   187 		{
   222 		{
   188 		// Do we have enough data to respond to the current transaction?
   223 		// Do we have enough data to respond to the current transaction?
   189 		TPtrC8 rawRequest = iTestCase->GetRawRequest(iConnectionIndex, iCurrentTrans);
   224 		TPtrC8 rawRequest = iTestCase->GetRawRequest(iConnectionIndex, iCurrentTrans);
   190 		TInt requestLength = rawRequest.Length();
   225 		TInt requestLength = rawRequest.Length();