applayerpluginsandutils/httpprotocolplugins/httpclient/chttpconnectionmanager.cpp
branchRCL_3
changeset 53 c59bddbfd7b9
parent 40 a0da872af3fa
equal deleted inserted replaced
40:a0da872af3fa 53:c59bddbfd7b9
   312 		__ASSERT_DEBUG( responseIndex != KErrNotFound, User::Invariant() );
   312 		__ASSERT_DEBUG( responseIndex != KErrNotFound, User::Invariant() );
   313 
   313 
   314 		// The request has not been made - just need to remove the request and
   314 		// The request has not been made - just need to remove the request and
   315 		// response objects from the pending queues.
   315 		// response objects from the pending queues.
   316 		iPendingRequests.Remove(requestIndex);
   316 		iPendingRequests.Remove(requestIndex);
   317 		
   317 
   318 		if (KErrNotFound != responseIndex)
   318         if (KErrNotFound != responseIndex)
   319 		    iPendingResponses.Remove(responseIndex);
   319         	iPendingResponses.Remove(responseIndex);
   320 		}
   320 		}
   321 	else if( responseIndex != KErrNotFound )
   321 	else if( responseIndex != KErrNotFound )
   322 		{
   322 		{
   323 		// The request has been sent but the response has not yet been received
   323 		// The request has been sent but the response has not yet been received
   324 		// and therefore need to stop the connection and remove response from 
   324 		// and therefore need to stop the connection and remove response from 
  1281 			{
  1281 			{
  1282 			// Read and try complete the response
  1282 			// Read and try complete the response
  1283 			TPtrC8 data;
  1283 			TPtrC8 data;
  1284 			__FLOG_0(_T8("!! doing an immediate socket read"));					
  1284 			__FLOG_0(_T8("!! doing an immediate socket read"));					
  1285 			TInt ret = iInputStream->ImmediateRead ( data );
  1285 			TInt ret = iInputStream->ImmediateRead ( data );
  1286 			if (ret) //we have some data read..so parse it
       
  1287 				{
       
  1288 				responseCompleted = iCurrentResponse->CompleteResponse ( data );
       
  1289 				}
       
  1290 			if ( ( iPendingResponses.Count() == 0 ) || ret <= KErrNone )
  1286 			if ( ( iPendingResponses.Count() == 0 ) || ret <= KErrNone )
  1291 				{
  1287 				{
  1292 				__FLOG_0(_T8("!! Breaking from the loop"));
  1288 				__FLOG_0(_T8("!! Breaking from the loop"));
  1293 				// no further data is expected or there is a socket error
  1289 				// no further data is expected or there is a socket error
  1294 				break;					
  1290 				break;					
  1295 				}
  1291 				}
       
  1292 			responseCompleted = iCurrentResponse->CompleteResponse ( data );
  1296 			}
  1293 			}
  1297 		}
  1294 		}
  1298 	}
  1295 	}
  1299 
  1296 
  1300 void CHttpConnectionManager::MOutputStreamObserver_Reserved()
  1297 void CHttpConnectionManager::MOutputStreamObserver_Reserved()