rem: DBG("DEBUG: t_forward_serial_branch: building req for branch"
add: LOG(L_ERR,"DEBUG: t_forward_serial_branch: building req for branch"
context: int forward_serial_branch(struct cell* Trans,int branch){	struct sip_msg*  p_msg = Trans->uas.request;	struct lump      *a, *b, *b1, *c;	unsigned int     len;	char             *buf=0, *shbuf=0;	str              backup_uri;	union sockaddr_union *to;	struct socket_info* send_sock;	backup_uri.s = p_msg->new_uri.s;	backup_uri.len = p_msg->new_uri.len;	/*generates branch param*/	if ( add_branch_label( Trans, p_msg , branch )==-1)		goto error;	/* remove all the HDR_VIA type lumps - they are in SHM memory!!! */	for(b=p_msg->add_rm,b1=0;b;b1=b,b=b->next)		if (b->type==HDR_VIA)		{			for(a=b->before;a;)				{c=a->before;shm_free_lump(a);a=c;}			for(a=b->after;a;)				{c=a->after;shm_free_lump(a);a=c;}			if (b1) b1->next = b->next;				else p_msg->add_rm = b->next;			shm_free_lump(b);		}	DBG("DEBUG: t_forward_serial_branch: building req for branch"		"%d; uri=|%.*s|.\n", branch, Trans->uac[branch].uri.len,		Trans->uac[branch].uri.s);	/* updates the new uri*/	p_msg->new_uri.s = Trans->uac[branch].uri.s;	p_msg->new_uri.len = Trans->uac[branch].uri.len;	to=&Trans->uac[branch].request.to;	send_sock=get_send_socket(to);	if (send_sock==0) {		LOG(L_ERR, "ERROR: t_forward_nonack: can't fwd to af %d "		"no corresponding listening socket\n", to->s.sa_family );		ser_error=E_NO_SOCKET;		goto error;	}	if ( !(buf = build_req_buf_from_sip_req  ( p_msg, &len, send_sock )))		goto error;	shm_free(Trans->uac[branch].uri.s);	/* allocates a new retrans_buff for the outbound request */	shbuf = (char *) shm_malloc( len );	if (!shbuf)	{		LOG(L_ERR, "ERROR: t_forward_serial_branch: out of shmem buffer\n");		goto error;	}	Trans->uac[branch].request.buffer = shbuf;	Trans->uac[branch].request.buffer_len = len ;	memcpy( Trans->uac[branch].request.buffer , buf , len );	/* keeps a hooker to uri inside buffer*/	Trans->uac[branch].uri.s = Trans->uac[branch].request.buffer +		(p_msg->first_line.u.request.uri.s - p_msg->buf);	Trans->uac[branch].uri.len=p_msg->new_uri.len?(p_msg->new_uri.len)		:(p_msg->first_line.u.request.uri.len);	Trans->nr_of_outgoings++ ;	/* send the request */	/* -v6; -jiri Trans->uac[branch].request.to.sin_family = AF_INET; */	SEND_BUFFER( &(T->uac[branch].request) );	pkg_free( buf ) ;	buf=NULL;	DBG("DEBUG: t_forward_serial_branch:starting timers (retrans and FR) %d\n",		get_ticks() );	/*sets and starts the FINAL RESPONSE timer */	set_timer( hash_table, &(T->uac[branch].request.fr_timer), 			FR_TIMER_LIST ); 			/* p_msg->REQ_METHOD==METHOD_INVITE ? FR_INV_TIMER_LIST : FR_TIMER_LIST ); */	/* sets and starts the RETRANS timer */	T->uac[branch].request.retr_list = RT_T1_TO_1;	set_timer( hash_table, &(T->uac[branch].request.retr_timer), RT_T1_TO_1 );	p_msg->new_uri.s = backup_uri.s;	p_msg->new_uri.len = backup_uri.len;	for(b=p_msg->add_rm,b1=0;b;b1=b,b=b->next)		if (b->type==HDR_VIA)		{			for(a=b->before;a;)				{c=a->before;free_lump(a);pkg_free(a);a=c;}			for(a=b->after;a;)				{c=a->after;free_lump(a);pkg_free(a);a=c;}			if (b1) b1->next = b->next;				else p_msg->add_rm = b->next;			free_lump(b);pkg_free(b);		}	return 1;error:	if (shbuf) shm_free(shbuf);	T->uac[branch].request.buffer=NULL;	if (buf) pkg_free( buf );	p_msg->new_uri.s = backup_uri.s;	p_msg->new_uri.len = backup_uri.len;	return -1;}