Patch: Fix crash (assertion failure) when pulling network cable during login

Vadim Lebedev vadim at mbdsys.com
Fri Aug 22 19:38:30 CEST 2008


Applied

Ralf Schlatterbeck wrote:
> 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 <rsc at runtux.com>
> # 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:%s@%s", 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:%s@%s:%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:%s@%s:%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:%s@%s", 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:%s@%s:%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:%s@%s:%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;
>   



More information about the QuteCom-dev mailing list