tcpiputils/dnd/src/resolver.cpp
branchRCL_3
changeset 22 8d540f55e491
parent 21 abbed5a4b42a
equal deleted inserted replaced
21:abbed5a4b42a 22:8d540f55e491
   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
   331 
   332 
   332 	// Specify Current Query state
   333 	// Specify Current Query state
   333 
   334 
   334 	const SQueryStep *iQueryStep;	//< The Current Query Process (what queries to make)
   335 	const SQueryStep *iQueryStep;	//< The Current Query Process (what queries to make)
   335 	SQueryStep iSpecificQuery;		//< Used in implementing the Specific Single Queries
   336 	SQueryStep iSpecificQuery;		//< Used in implementing the Specific Single Queries
   839 			return;
   840 			return;
   840 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d Probing QType=%d (%S) -- Assigned DNS session [%u]"),
   841 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d Probing QType=%d (%S) -- Assigned DNS session [%u]"),
   841 			iId, (TInt)iCurrentQuery().iSession, (TInt)iProbe.iQType, &iProbe.iName, (TInt)iProbe.iSession->Instance())); 
   842 			iId, (TInt)iCurrentQuery().iSession, (TInt)iProbe.iQType, &iProbe.iName, (TInt)iProbe.iSession->Instance())); 
   842 		// Use the current query as a probe starting point
   843 		// Use the current query as a probe starting point
   843 		//(void)iProbe.iSession->NewQuery(*iSession[0].iSession);
   844 		//(void)iProbe.iSession->NewQuery(*iSession[0].iSession);
   844 		(void)iProbe.iSession->NewQuery(iCurrentQuery(),iSourceNow,iQueryFlags | KDnsModifier_PQ);
   845 		(void)iProbe.iSession->NewQuery(iCurrentQuery(),iSourceNow,iQueryFlags | KDnsModifier_PQ, iSuffixSupportEnabled);
   845 		
   846 		
   846 		// initialize server (which is not tried)
   847 		// initialize server (which is not tried)
   847 		(void)iProbe.iSession->PickDefaultServer();
   848 		(void)iProbe.iSession->PickDefaultServer();
   848 		}
   849 		}
   849 	// Start query, but only if there really is another server address
   850 	// Start query, but only if there really is another server address
  1109 	// Stack should never start new request before delivering the response.
  1110 	// Stack should never start new request before delivering the response.
  1110 	// Exception is the Cancel-request which is treated above.
  1111 	// Exception is the Cancel-request which is treated above.
  1111 	ASSERT(iQueryDoneWait == 0);
  1112 	ASSERT(iQueryDoneWait == 0);
  1112 	
  1113 	
  1113 	iBuffer = aMsg;
  1114 	iBuffer = aMsg;
       
  1115 	iSuffixSupportEnabled = cf.iSuffixSupportEnabled;
  1114 	//
  1116 	//
  1115 	// A new command/query from the application
  1117 	// A new command/query from the application
  1116 	//
  1118 	//
  1117 	LOG(ShowQuery(iBuffer(), 0));
  1119 	LOG(ShowQuery(iBuffer(), 0));
  1118 
  1120 
  1379 		{
  1381 		{
  1380 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d QType=%d (%S) -- Assigned DNS session [%u]"),
  1382 		LOG(Log::Printf(_L("\tresolver[%d] SESSION %d QType=%d (%S) -- Assigned DNS session [%u]"),
  1381 			iResolver->iId, iResolver->iCurrentQuery().iSession, (TInt)iQType, &iName, (TInt)iSession->Instance()));
  1383 			iResolver->iId, iResolver->iCurrentQuery().iSession, (TInt)iQType, &iName, (TInt)iSession->Instance()));
  1382 		// ..if NewQuery returns an error, it will be the result of the query. Otherwise
  1384 		// ..if NewQuery returns an error, it will be the result of the query. Otherwise
  1383 		// use the KErrEof as initial value.
  1385 		// use the KErrEof as initial value.
  1384 		iStatus = iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags);
  1386 		iStatus = iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags, iResolver->iSuffixSupportEnabled);
  1385 		if (iStatus == KErrNone)
  1387 		if (iStatus == KErrNone)
  1386 			iStatus = KErrEof;	// No content yet.
  1388 			iStatus = KErrEof;	// No content yet.
  1387 #ifdef SYMBIAN_DNS_PUNYCODE
  1389 #ifdef SYMBIAN_DNS_PUNYCODE
  1388 		else // in case the Query String is UTF-16 encoded
  1390 		else // in case the Query String is UTF-16 encoded
  1389 			{
  1391 			{
  1626 
  1628 
  1627 		// Reload the query too (this is only sometimes needed with PTR
  1629 		// Reload the query too (this is only sometimes needed with PTR
  1628 		// queries if the filter iLockId cannot be determined due to
  1630 		// queries if the filter iLockId cannot be determined due to
  1629 		// missing interfaces. And only happens if query address was
  1631 		// missing interfaces. And only happens if query address was
  1630 		// without scope id.
  1632 		// without scope id.
  1631 		(void)iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags);
  1633 		(void)iSession->NewQuery(iResolver->iCurrentQuery(), iResolver->iSourceNow, iResolver->iQueryFlags, iResolver->iSuffixSupportEnabled);
  1632 		SendDnsQuery();
  1634 		SendDnsQuery();
  1633 		return;
  1635 		return;
  1634 		}
  1636 		}
  1635 
  1637 
  1636 	if (aTimeOut)
  1638 	if (aTimeOut)