[svn-commits] rizzo: branch rizzo/astobj2 r47969 - /team/rizzo/astobj2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Nov 23 09:11:54 MST 2006


Author: rizzo
Date: Thu Nov 23 10:11:53 2006
New Revision: 47969

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47969
Log:
simplify handling of eventheader in handle_request_subscribe()

Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47969&r1=47968&r2=47969
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Thu Nov 23 10:11:53 2006
@@ -14662,7 +14662,7 @@
 	const char *eventheader = get_header(req, "Event");	/* Get Event package name */
 	const char *accept = get_header(req, "Accept");
 	int resubscribe = (p->subscribed != NONE);
-	char *temp, *event;
+	char *event;
 
 	if (p->initreq.headers) {	
 		/* We already have a dialog */
@@ -14714,14 +14714,6 @@
 		return 0;
 	}
 
-	if ( (strchr(eventheader, ';'))) {
-		event = ast_strdupa(eventheader);	/* Since eventheader is a const, we can't change it */
-		temp = strchr(event, ';'); 		
-		*temp = '\0';				/* Remove any options for now */
-							/* We might need to use them later :-) */
-	} else
-		event = (char *) eventheader;		/* XXX is this legal ? */
-
 	/* Handle authentication */
 	res = check_user_full(p, req, SIP_SUBSCRIBE, e, 0, sin, &authpeer);
 	/* if an authentication response was sent, we are done here */
@@ -14775,6 +14767,9 @@
 	/* Initialize tag for new subscriptions */	
 	if (ast_strlen_zero(p->tag))
 		make_our_tag(p->tag, sizeof(p->tag));
+
+	event = ast_strdupa(eventheader);	/* Since eventheader is a const, we can't change it */
+	event = strsep(&event, ";");		/* Remove any options for now */
 
 	if (!strcmp(event, "presence") || !strcmp(event, "dialog")) { /* Presence, RFC 3842 */
 		/* We do not need the authpeer any more */



More information about the svn-commits mailing list