add: if (e2e_ack_trans) { p_cell=e2e_ack_trans; goto e2e_ack; }
context: int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked ){	struct cell         *p_cell;	unsigned int       isACK;	struct sip_msg  *t_msg;	int ret;	struct via_param *branch;	int match_status;	/* parse all*/	if (check_transaction_quadruple(p_msg)==0)	{		LOG(L_ERR, "ERROR: TM module: t_lookup_request: too few headers\n");		set_t(0);			/* stop processing */		return 0;	}	/* start searching into the table */	if (!p_msg->hash_index)		p_msg->hash_index=hash( p_msg->callid->body , get_cseq(p_msg)->number ) ;	isACK = p_msg->REQ_METHOD==METHOD_ACK;	DBG("t_lookup_request: start searching: hash=%d, isACK=%d\n",		p_msg->hash_index,isACK);	/* assume not found */	ret=-1;	/* first of all, look if there is RFC3261 magic cookie in branch; if	 * so, we can do very quick matching and skip the old-RFC bizzar	 * comparison of many header fields	 */	if (!p_msg->via1) {		LOG(L_ERR, "ERROR: t_lookup_request: no via\n");		set_t(0);			return 0;	}	branch=p_msg->via1->branch;	if (branch && branch->value.s && branch->value.len>MCOOKIE_LEN			&& memcmp(branch->value.s,MCOOKIE,MCOOKIE_LEN)==0) {		/* huhuhu! the cookie is there -- let's proceed fast */		LOCK_HASH(p_msg->hash_index);		match_status=matching_3261(p_msg,&p_cell, 				/* skip transactions with different method; otherwise CANCEL would 	 	 		 * match the previous INVITE trans.  */				isACK ? ~METHOD_INVITE: ~p_msg->REQ_METHOD);		switch(match_status) {				case 0:	goto notfound;	/* no match */				case 1:	goto found; 	/* match */				case 2:	goto e2e_ack;	/* e2e proxy ACK */		}	}	/* ok -- it's ugly old-fashioned transaction matching -- it is	 * a bit simplified to be fast -- we don't do all the comparisons	 * of parsed uri, which was simply too bloated */	DBG("DEBUG: proceeding to pre-RFC3261 transaction matching\n");	/* lock the whole entry*/	LOCK_HASH(p_msg->hash_index);	/* all the transactions from the entry are compared */	for ( p_cell = get_tm_table()->entrys[p_msg->hash_index].first_cell;		  p_cell; p_cell = p_cell->next_cell ) 	{		t_msg = p_cell->uas.request;		if (!t_msg) continue; /* skip UAC transactions */		if (!isACK) {				/* compare lengths first */ 			if (!EQ_LEN(callid)) continue;			if (!EQ_LEN(cseq)) continue;			if (!EQ_LEN(from)) continue;			if (!EQ_LEN(to)) continue;			if (ruri_matching && !EQ_REQ_URI_LEN) continue;			if (via1_matching && !EQ_VIA_LEN(via1)) continue;			/* length ok -- move on */			if (!EQ_STR(callid)) continue;			if (!EQ_STR(cseq)) continue;			if (!EQ_STR(from)) continue;			if (!EQ_STR(to)) continue;			if (ruri_matching && !EQ_REQ_URI_STR) continue;			if (via1_matching && !EQ_VIA_STR(via1)) continue;			/* request matched ! */			DBG("DEBUG: non-ACK matched\n");			goto found;		} else { /* it's an ACK request*/			/* ACK's relate only to INVITEs */			if (t_msg->REQ_METHOD!=METHOD_INVITE) continue;			/* From|To URI , CallID, CSeq # must be always there */			/* compare lengths now */			if (!EQ_LEN(callid)) continue;			/* CSeq only the number without method ! */			if (get_cseq(t_msg)->number.len!=get_cseq(p_msg)->number.len)				continue;			if (! EQ_LEN(from)) continue;			/* To only the uri -- to many UACs screw up tags  */			if (get_to(t_msg)->uri.len!=get_to(p_msg)->uri.len)				continue;			if (!EQ_STR(callid)) continue;			if (memcmp(get_cseq(t_msg)->number.s, get_cseq(p_msg)->number.s,				get_cseq(p_msg)->number.len)!=0) continue;			if (!EQ_STR(from)) continue;			if (memcmp(get_to(t_msg)->uri.s, get_to(p_msg)->uri.s,				get_to(t_msg)->uri.len)!=0) continue;			/* it is e2e ACK/200 */			if (p_cell->uas.status<300) {				/* all criteria for proxied ACK are ok */				if (p_cell->relaied_reply_branch!=-2) 					goto e2e_ack;				/* it's a local UAS transaction */				if (dlg_matching(p_cell, p_msg))					goto found;				continue;			}			/* it is not an e2e ACK/200 -- perhaps it is 			 * local negative case; in which case we will want			 * more elements to match: r-uri and via; allow			 * mismatching r-uri as an config option for broken			 * UACs */			if (ruri_matching && !EQ_REQ_URI_LEN ) continue;			if (via1_matching && !EQ_VIA_LEN(via1)) continue;			if (ruri_matching && !EQ_REQ_URI_STR) continue;			if (via1_matching && !EQ_VIA_STR(via1)) continue;			/* wow -- we survived all the check! we matched! */			DBG("DEBUG: non-2xx ACK matched\n");			goto found;		} /* ACK */	} /* synonym loop */notfound:	/* no transaction found */	set_t(0);	if (!leave_new_locked) {		UNLOCK_HASH(p_msg->hash_index);	}	DBG("DEBUG: t_lookup_request: no transaction found\n");	return -1;e2e_ack:	t_ack=p_cell;	/* e2e proxied ACK */	set_t(0);	if (!leave_new_locked) {		UNLOCK_HASH(p_msg->hash_index);	}	DBG("DEBUG: t_lookup_request: e2e proxy ACK found\n");	return -2;found:	set_t(p_cell);	REF_UNSAFE( T );	set_kr(REQ_EXIST);	UNLOCK_HASH( p_msg->hash_index );	DBG("DEBUG: t_lookup_request: transaction found (T=%p)\n",T);	return 1;}