You can remove the "hopefully" from the check-in comment now.
We're still seeing all sorts of weird behaviour when a laptop goes to
sleep. From random crashes to freezes (of kvats). This only one of
those (lowhanging fruits first) and by far the most common one and
reproduceable.

# HG changeset patch
# User Ralf Schlatterbeck <[EMAIL PROTECTED]>
# Date 1219316854 -7200
# Node ID bb0494a255d805017ea4d1b10697325bde7263ef
# Parent  8ca4eea0c37d43c07604f9197217c5134d676a73
hopefully fix abort when ethernet disconnected during sip login
hopefully fixes one of the coredumps with issue101

diff -r 8ca4eea0c37d -r bb0494a255d8 wifo/phapi/phvline.c
--- a/wifo/phapi/phvline.c      Tue Aug 12 22:37:16 2008 +0200
+++ b/wifo/phapi/phvline.c      Thu Aug 21 13:07:34 2008 +0200
@@ -336,51 +336,60 @@ phvlRegisterNoLock(int vlid)
        char utmp[256];
        char stmp[256];
        char *server;
+       char *user = NULL;
+       char *domain = NULL;
 
        assert(vl);
-       assert(owsip_account_user_get (vl->sipAccount));
-       assert(owsip_account_domain_get (vl->sipAccount));
-
-       snprintf(utmp, sizeof(utmp), "sip:[EMAIL PROTECTED]", 
owsip_account_user_get (vl->sipAccount), owsip_account_domain_get 
(vl->sipAccount));
-
-       server = stmp;
-       if (owsip_account_port_get (vl->sipAccount) && owsip_account_port_get 
(vl->sipAccount) != 5060)
-       {
-               /* snprintf(stmp, sizeof(stmp), "sip:[EMAIL PROTECTED]:%d", 
vl->username, vl->server, vl->port); */
-               snprintf(stmp, sizeof(stmp), "sip:%s:%d", 
owsip_account_domain_get (vl->sipAccount), owsip_account_port_get 
(vl->sipAccount));
-       }
-       else
-       {
-               /* snprintf(stmp, sizeof(stmp), "sip:[EMAIL PROTECTED]:%d", 
vl->username, vl->server, vl->port); */
-               snprintf(stmp, sizeof(stmp), "sip:%s", owsip_account_domain_get 
(vl->sipAccount)); 
-       }
-
-       vl->rid = eXosip_register_init(vl->sipAccount, utmp, server, 
owsip_account_proxy_get (vl->sipAccount));
-
-       if (vl->rid >= 0)
-       {
-               if (vl->regTimeout > 0)
-               {
-                       if (vl->LineState != LINESTATE_REGISTERED && 
vl->LineState != LINESTATE_REGISTERING)
-                       {
-                               _owplLineSetState(vlid, LINESTATE_REGISTERING, 
LINESTATE_CAUSE_NORMAL);
-                       }
+
+       user = owsip_account_user_get (vl->sipAccount);
+       domain = owsip_account_domain_get (vl->sipAccount);
+
+       if (user && domain)
+       {
+               snprintf(utmp, sizeof(utmp), "sip:[EMAIL PROTECTED]", 
owsip_account_user_get (vl->sipAccount), owsip_account_domain_get 
(vl->sipAccount));
+
+               server = stmp;
+               if (owsip_account_port_get (vl->sipAccount) && 
owsip_account_port_get (vl->sipAccount) != 5060)
+               {
+                       /* snprintf(stmp, sizeof(stmp), "sip:[EMAIL 
PROTECTED]:%d", vl->username, vl->server, vl->port); */
+                       snprintf(stmp, sizeof(stmp), "sip:%s:%d", 
owsip_account_domain_get (vl->sipAccount), owsip_account_port_get 
(vl->sipAccount));
                }
                else
                {
-                       if (vl->LineState == LINESTATE_REGISTERED)
-                       {
-                               _owplLineSetState(vlid, 
LINESTATE_UNREGISTERING, LINESTATE_CAUSE_NORMAL);
-                       }
-               }
-
-               ret = eXosip_register(vl->rid, vl->regTimeout);
-
-               if (ret == 0)
-               {
-                       ret = vl->rid;
-                       vl->lastRegTime = time(0);
-               }
+                       /* snprintf(stmp, sizeof(stmp), "sip:[EMAIL 
PROTECTED]:%d", vl->username, vl->server, vl->port); */
+                       snprintf(stmp, sizeof(stmp), "sip:%s", 
owsip_account_domain_get (vl->sipAccount)); 
+               }
+
+               vl->rid = eXosip_register_init(vl->sipAccount, utmp, server, 
owsip_account_proxy_get (vl->sipAccount));
+
+               if (vl->rid >= 0)
+               {
+                       if (vl->regTimeout > 0)
+                       {
+                               if (vl->LineState != LINESTATE_REGISTERED && 
vl->LineState != LINESTATE_REGISTERING)
+                               {
+                                       _owplLineSetState(vlid, 
LINESTATE_REGISTERING, LINESTATE_CAUSE_NORMAL);
+                               }
+                       }
+                       else
+                       {
+                               if (vl->LineState == LINESTATE_REGISTERED)
+                               {
+                                       _owplLineSetState(vlid, 
LINESTATE_UNREGISTERING, LINESTATE_CAUSE_NORMAL);
+                               }
+                       }
+
+                       ret = eXosip_register(vl->rid, vl->regTimeout);
+
+                       if (ret == 0)
+                       {
+                               ret = vl->rid;
+                               vl->lastRegTime = time(0);
+                       }
+               }
+       } else  {
+               ret = vl->rid;
+               vl->lastRegTime = time(0);
        }
 
        return ret;
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  Fax:   +43/2243/26465-23
Reichergasse 131                        www:   http://www.runtux.com
A-3411 Weidling                         email: [EMAIL PROTECTED]
osAlliance member                       email: [EMAIL PROTECTED]
_______________________________________________
QuteCom-dev mailing list
[email protected]
http://lists.qutecom.org/mailman/listinfo/qutecom-dev

Reply via email to