[asterisk-dev] Re: [asterisk-commits] russell: trunk r44876 - /trunk/channels/chan_sip.c

Luigi Rizzo rizzo at icir.org
Wed Oct 11 06:45:32 MST 2006


On Wed, Oct 11, 2006 at 01:38:38PM -0000, asterisk-commits at lists.digium.com wrote:
> Author: russell
> Date: Wed Oct 11 08:38:37 2006
> New Revision: 44876
> 
> URL: http://svn.digium.com/view/asterisk?rev=44876&view=rev
> Log:
> Revert Luigi's accidental commit of his local changes when debugging some SIP
> authentication issues.  This was committed in revision 44844, where the commit
> message was just "small formatting cleanup", so I am pretty sure he didn't mean
> to commit this part.
> 

correct - sorry for the mistake.

In fact i was about to change it into

        if (0) {
                /*
                 * XXX This is experimental code to grab the search key from the
                 * Auth header's username instead of the 'From' name, if available.
                 * Do not enable this block unless you understand the side effects (if any!)
                 * Note, the search for "username" should be done in a more robust way.
                 */
                const char *hdr = (sipmethod == SIP_REGISTER || sipmethod == SIP_SUBSCRIBE) ?
                        "Authorization" : "Proxy-Authorization";
                if ( (hdr = get_header(req, hdr)) && (hdr = strstr(hdr, "username=\"")) ) {
                        ast_copy_string(from, hdr + strlen("username=\""), sizeof(from));
                        of = from;
                        of = strsep(&of, "\"");
                }
        }

with the following commit message:

	Whoops... in a previous commit i left in a small block of experimental
	code (that i previously posted on the -dev mailing list) to improve
	peer matching on incoming calls.

	Since it's in, rather than deleting it, i think it is preferable
	to if (0) the block and describe in a bit of detail what the code
	does, so developers can give it a try if they like, and then we
	can decide what to do.

	Of course if there is consensus that this does not belong
	here, feel free to remove this if (0) { } block.

	Sorry again for the mistake - it was not deliberate.

but you were quicker :)

	cheers
	luigi

>     trunk/channels/chan_sip.c
> 
> Modified: trunk/channels/chan_sip.c
> URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=44876&r1=44875&r2=44876&view=diff
> ==============================================================================
> --- trunk/channels/chan_sip.c (original)
> +++ trunk/channels/chan_sip.c Wed Oct 11 08:38:37 2006
> @@ -8710,16 +8710,6 @@
>  	}
>  	if (ast_strlen_zero(of))
>  		return AUTH_SUCCESSFUL;
> -
> -	if (1) {
> -		const char *hdr = (sipmethod == SIP_REGISTER || sipmethod == SIP_SUBSCRIBE) ?
> -			"Authorization" : "Proxy-Authorization";
> -		if ( (hdr = get_header(req, hdr)) && (hdr = strstr(hdr, "username=\"")) ) {
> -			ast_copy_string(from, hdr + strlen("username=\""), sizeof(from));
> -			of = from;
> -			of = strsep(&of, "\"");
> -		}
> -	}
>  
>  	if (!authpeer)	/* If we are looking for a peer, don't check the user objects (or realtime) */
>  		user = find_user(of, 1);
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-commits mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-commits


More information about the asterisk-dev mailing list