[asterisk-commits] rizzo: branch rizzo/astobj2 r47453 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Nov 10 11:54:07 MST 2006


Author: rizzo
Date: Fri Nov 10 12:54:07 2006
New Revision: 47453

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47453
Log:
put fields close to each other, and remove a duplicate statement

trunk candidate.


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=47453&r1=47452&r2=47453
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Fri Nov 10 12:54:07 2006
@@ -2044,17 +2044,16 @@
 	if (!(pkt = ast_calloc(1, sizeof(*pkt) + len + 1)))
 		return AST_FAILURE;
 	memcpy(pkt->data, data, len);
+	pkt->data[len] = '\0';
+	pkt->packetlen = len;
 	pkt->method = sipmethod;
-	pkt->packetlen = len;
-	pkt->next = p->packets;
 	pkt->pvt = pvt_ref(p);
 	pkt->seqno = seqno;
 	if (resp)
 		ast_set_flag(pkt, FLAG_RESPONSE);
-	pkt->data[len] = '\0';
-	pkt->timer_t1 = p->timer_t1;	/* Set SIP timer T1 */
 	if (fatal)
 		ast_set_flag(pkt, FLAG_FATAL);
+	pkt->timer_t1 = p->timer_t1;	/* Set SIP timer T1 */
 	if (pkt->timer_t1)
 		siptimer_a = pkt->timer_t1 * 2;
 
@@ -2062,6 +2061,7 @@
 	pkt->retransid = ast_sched_add_variable(sched, siptimer_a, retrans_pkt, pkt, 1);
 	if (option_debug > 3 && sipdebug)
 		ast_log(LOG_DEBUG, "*** SIP TIMER: Initalizing retransmit timer on packet: Id  #%d\n", pkt->retransid);
+	/* link at the head of the list */
 	pkt->next = p->packets;
 	p->packets = pkt;
 



More information about the asterisk-commits mailing list