]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Revert 6e818216e2e615f3241a34253cdea8ee316d9e88, from FS-6287 as it breaks challenge...
authorBrian West <brian@freeswitch.org>
Mon, 17 Mar 2014 20:03:03 +0000 (15:03 -0500)
committerBrian West <brian@freeswitch.org>
Mon, 17 Mar 2014 20:03:08 +0000 (15:03 -0500)
libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c

index 467235cd8ba8f7d7df97d937d1012b01efd2addc..c5400dd4ca3d43fd1a34e5fbe0e8f77bd6140e88 100644 (file)
@@ -1197,9 +1197,13 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
 
       cr->cr_challenged = 1;
 
-      if (!invalid && auc_has_authorization(&nh->nh_auth)) {
-                 return nua_client_restart(cr, 100, "Request Authorized by Cache");
-         }
+      if (invalid) {
+       /* Bad username/password */
+       SU_DEBUG_7(("nua(%p): bad credentials, clearing them\n", (void *)nh));
+       auc_clear_credentials(&nh->nh_auth, NULL, NULL);
+      }
+      else if (auc_has_authorization(&nh->nh_auth))
+       return nua_client_restart(cr, 100, "Request Authorized by Cache");
 
       orq = cr->cr_orq, cr->cr_orq = NULL;
 
@@ -1209,7 +1213,7 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
       cr->cr_status = 0, cr->cr_phrase = NULL;
       nua_client_request_unref(cr);
 
-      return 0;
+      return 1;
     }
   }
   /* GriGiu : RFC-3261 status supported Retry-After */