]> sjero.net Git - linphone/commitdiff
fix compile warning
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 14 Sep 2012 16:26:44 +0000 (18:26 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 14 Sep 2012 16:26:44 +0000 (18:26 +0200)
coreapi/sal_eXosip2.c

index 821e4ab39cb55b143eec14e4a2dac84a973a5239..b09cae4ffc3da254eef78fd9d309219eb53caaff 100644 (file)
@@ -2261,21 +2261,23 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
 int sal_register_refresh(SalOp *op, int expires){
        osip_message_t *msg=NULL;
        const char *contact=sal_op_get_contact(op);
-       int tries=0;
        
        if (op->rid==-1){
                ms_error("Unexistant registration context, not possible to refresh.");
                return -1;
        }
 #ifdef HAVE_EXOSIP_TRYLOCK
-       /*iOS hack: in the keep alive handler, we have no more than 10 seconds to refresh registers, otherwise the application is suspended forever.
-        * In order to prevent this case that can occur when the exosip thread is busy with DNS while network isn't in a good shape, we try to take
-        * the exosip lock in a non blocking way, and give up if it takes too long*/
-       while (eXosip_trylock()!=0){
-               ms_usleep(100000);
-               if (tries>30) {/*after 3 seconds, give up*/
-                       ms_warning("Could not obtain exosip lock in a reasonable time, giving up.");
-                       return -1;
+       {
+               int tries=0;
+               /*iOS hack: in the keep alive handler, we have no more than 10 seconds to refresh registers, otherwise the application is suspended forever.
+               * In order to prevent this case that can occur when the exosip thread is busy with DNS while network isn't in a good shape, we try to take
+               * the exosip lock in a non blocking way, and give up if it takes too long*/
+               while (eXosip_trylock()!=0){
+                       ms_usleep(100000);
+                       if (tries>30) {/*after 3 seconds, give up*/
+                               ms_warning("Could not obtain exosip lock in a reasonable time, giving up.");
+                               return -1;
+                       }
                }
        }
 #else