[Freeswitch-svn] [commit] r12285 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sresolv

FreeSWITCH SVN mikej at freeswitch.org
Wed Feb 25 11:39:24 PST 2009


Author: mikej
Date: Wed Feb 25 13:39:24 2009
New Revision: 12285

Log:
Wed Feb 25 13:10:24 CST 2009  Pekka Pessi <first.last at nokia.com>
  * sres_sip.c: be more robust if the DNS fails badly
  Ignore-this: 1922836529de164a842ab88e848066a0



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Wed Feb 25 13:39:24 2009
@@ -1 +1 @@
-Wed Feb 25 13:37:49 CST 2009
+Wed Feb 25 13:39:07 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c	Wed Feb 25 13:39:24 2009
@@ -767,24 +767,26 @@
 		(void *)srs, sres_record_type(type, NULL), domain,
 		answers ? " (cached)" : ""));
 
-    if (answers) {
-      sres_sip_answer(step, NULL, answers);
-      return process = 1;
-    }
+    if (answers)
+      ;
     else if (srs->srs_blocking) {
       sres_blocking_query(srs->srs_resolver, type, domain, 0, &answers);
-      sres_sip_answer(step, NULL, answers);
-      return process = 1;
     }
     else {
       step->sp_query = sres_query(srs->srs_resolver,
 				  sres_sip_answer, step,
 				  type, domain);
-      /* Query all self-generated SRV records at the same time */
-      parallel = step->sp_trace == NULL && type == sres_type_srv;
-      if (!parallel)
-	break;
+      if (step->sp_query) {
+	/* Query all self-generated SRV records at the same time */
+	parallel = step->sp_trace == NULL && type == sres_type_srv;
+	if (!parallel)
+	  break;
+	continue;
+      }
     }
+
+    sres_sip_answer(step, NULL, answers);
+    return process = 1;
   }
 
   return process = 0;
@@ -837,7 +839,10 @@
 {
   int i;
 
-  for (i = 0; answers && answers[i]; i++) {
+  if (answers == NULL)
+    return SRES_NETWORK_ERR;
+
+  for (i = 0; answers[i]; i++) {
     if (answers[i]->sr_record->r_type == type) {
       return answers[i]->sr_record->r_status;
     }
@@ -956,12 +961,16 @@
 	break;
       case SRES_SERVER_ERR:
       case SRES_TIMEOUT_ERR:
+      case SRES_NETWORK_ERR:
 	srs->srs_error = SRES_SIP_ERR_AGAIN;
 	break;
       }
       if (srs->srs_error)
 	break;
     }
+
+    if (!srs->srs_error)
+      srs->srs_error = SRES_SIP_ERR_FAIL;
   }
 
   if (srs->srs_callback) {



More information about the Freeswitch-svn mailing list