tcpiputils/dnd/src/resolver.cpp
branchRCL_3
changeset 75 c1029e558ef5
parent 58 8d540f55e491
equal deleted inserted replaced
67:bb2423252ea3 75:c1029e558ef5
   326 	TUint iQueryStepMaxTime;		//< Maximum time allowed for single query step to complete
   326 	TUint iQueryStepMaxTime;		//< Maximum time allowed for single query step to complete
   327 	TUint iQueryStepMinTime;		//< Minimum time for query step (usage depends on mode)
   327 	TUint iQueryStepMinTime;		//< Minimum time for query step (usage depends on mode)
   328 	TUint8 iQueryStepRetries;		//< Additional retries after the primary attempt
   328 	TUint8 iQueryStepRetries;		//< Additional retries after the primary attempt
   329 	TInt iSourceCount;				//< Remaining number of sources.
   329 	TInt iSourceCount;				//< Remaining number of sources.
   330 	TInt iNext;						//< Non-zero, if executing Next operation
   330 	TInt iNext;						//< Non-zero, if executing Next operation
   331 	TBool iSuffixSupportEnabled;	//< Flag to switch on/off the domain suffix list support in name resolution
       
   332 
   331 
   333 	// Specify Current Query state
   332 	// Specify Current Query state
   334 
   333 
   335 	const SQueryStep *iQueryStep;	//< The Current Query Process (what queries to make)
   334 	const SQueryStep *iQueryStep;	//< The Current Query Process (what queries to make)
   336 	SQueryStep iSpecificQuery;		//< Used in implementing the Specific Single Queries
   335 	SQueryStep iSpecificQuery;		//< Used in implementing the Specific Single Queries
   575 	if (aResult < 0)
   574 	if (aResult < 0)
   576 		{
   575 		{
   577 		StopSource();
   576 		StopSource();
   578 		iBuffer.SetLength(iBuffer().HeaderSize());
   577 		iBuffer.SetLength(iBuffer().HeaderSize());
   579 		}
   578 		}
       
   579 	// Added
       
   580 	if (iQueryActive)
       
   581 	    {
       
   582 	    iQueryActive = 0;
       
   583 	    iDnsclient.QueryEnd();
       
   584 	    }
   580 	LOG(ShowQuery(iBuffer(), 1));
   585 	LOG(ShowQuery(iBuffer(), 1));
   581 	iListener.PostReply();	
   586 	iListener.PostReply();	
   582 	}
   587 	}
   583 
   588 
   584 // CDndResolver::ReplyMessage
   589 // CDndResolver::ReplyMessage
   840 			return;
   845 			return;
   841 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d Probing QType=%d (%S) -- Assigned DNS session [%u]"),
   846 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d Probing QType=%d (%S) -- Assigned DNS session [%u]"),
   842 			iId, (TInt)iCurrentQuery().iSession, (TInt)iProbe.iQType, &iProbe.iName, (TInt)iProbe.iSession->Instance())); 
   847 			iId, (TInt)iCurrentQuery().iSession, (TInt)iProbe.iQType, &iProbe.iName, (TInt)iProbe.iSession->Instance())); 
   843 		// Use the current query as a probe starting point
   848 		// Use the current query as a probe starting point
   844 		//(void)iProbe.iSession->NewQuery(*iSession[0].iSession);
   849 		//(void)iProbe.iSession->NewQuery(*iSession[0].iSession);
   845 		(void)iProbe.iSession->NewQuery(iCurrentQuery(),iSourceNow,iQueryFlags | KDnsModifier_PQ, iSuffixSupportEnabled);
   850 		(void)iProbe.iSession->NewQuery(iCurrentQuery(),iSourceNow,iQueryFlags | KDnsModifier_PQ);
   846 		
   851 		
   847 		// initialize server (which is not tried)
   852 		// initialize server (which is not tried)
   848 		(void)iProbe.iSession->PickDefaultServer();
   853 		(void)iProbe.iSession->PickDefaultServer();
   849 		}
   854 		}
   850 	// Start query, but only if there really is another server address
   855 	// Start query, but only if there really is another server address
  1110 	// Stack should never start new request before delivering the response.
  1115 	// Stack should never start new request before delivering the response.
  1111 	// Exception is the Cancel-request which is treated above.
  1116 	// Exception is the Cancel-request which is treated above.
  1112 	ASSERT(iQueryDoneWait == 0);
  1117 	ASSERT(iQueryDoneWait == 0);
  1113 	
  1118 	
  1114 	iBuffer = aMsg;
  1119 	iBuffer = aMsg;
  1115 	iSuffixSupportEnabled = cf.iSuffixSupportEnabled;
       
  1116 	//
  1120 	//
  1117 	// A new command/query from the application
  1121 	// A new command/query from the application
  1118 	//
  1122 	//
  1119 	LOG(ShowQuery(iBuffer(), 0));
  1123 	LOG(ShowQuery(iBuffer(), 0));
  1120 
  1124 
  1381 		{
  1385 		{
  1382 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d QType=%d (%S) -- Assigned DNS session [%u]"),
  1386 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d QType=%d (%S) -- Assigned DNS session [%u]"),
  1383 			iResolver->iId, iResolver->iCurrentQuery().iSession, (TInt)iQType, &iName, (TInt)iSession->Instance()));
  1387 			iResolver->iId, iResolver->iCurrentQuery().iSession, (TInt)iQType, &iName, (TInt)iSession->Instance()));
  1384 		// ..if NewQuery returns an error, it will be the result of the query. Otherwise
  1388 		// ..if NewQuery returns an error, it will be the result of the query. Otherwise
  1385 		// use the KErrEof as initial value.
  1389 		// use the KErrEof as initial value.
  1386 		iStatus = iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags, iResolver->iSuffixSupportEnabled);
  1390 		iStatus = iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags);
  1387 		if (iStatus == KErrNone)
  1391 		if (iStatus == KErrNone)
  1388 			iStatus = KErrEof;	// No content yet.
  1392 			iStatus = KErrEof;	// No content yet.
  1389 #ifdef SYMBIAN_DNS_PUNYCODE
  1393 #ifdef SYMBIAN_DNS_PUNYCODE
  1390 		else // in case the Query String is UTF-16 encoded
  1394 		else // in case the Query String is UTF-16 encoded
  1391 			{
  1395 			{
  1628 
  1632 
  1629 		// Reload the query too (this is only sometimes needed with PTR
  1633 		// Reload the query too (this is only sometimes needed with PTR
  1630 		// queries if the filter iLockId cannot be determined due to
  1634 		// queries if the filter iLockId cannot be determined due to
  1631 		// missing interfaces. And only happens if query address was
  1635 		// missing interfaces. And only happens if query address was
  1632 		// without scope id.
  1636 		// without scope id.
  1633 		(void)iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags, iResolver->iSuffixSupportEnabled);
  1637 		(void)iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags);
  1634 		SendDnsQuery();
  1638 		SendDnsQuery();
  1635 		return;
  1639 		return;
  1636 		}
  1640 		}
  1637 
  1641 
  1638 	if (aTimeOut)
  1642 	if (aTimeOut)