rem: DBG("t_lookup_request: start searching\n");  if (check_transaction_quadruple(p_msg)==0) { LOG(L_ERR, "ERROR: TM module: t_lookup_request: too few headers\n"); T=T_NULL; return -1; }
context: int t_lookup_request( struct sip_msg* p_msg, char* foo, char* bar  ){   struct cell      *p_cell;   struct cell      *tmp_cell;   unsigned int  hash_index=0;   unsigned int  isACK = 0;   /* it's about the same transaction or not?*/   if ( global_msg_id != p_msg->id )   {      T = T_UNDEFINED;      global_msg_id = p_msg->id;   }    /* if  T is previous found -> return found */   if ( T!=T_UNDEFINED && T )	{      DBG("DEBUG: t_lookup_request: T already exists\n");      return 1;   }    /* if T was previous searched and not found -> return not found*/   if ( !T )	{	DBG("DEBUG: t_lookup_request: T previously sought and not found\n");      return -1;   }   DBG("t_lookup_request: start searching\n");   /* parse all*/   if (check_transaction_quadruple(p_msg)==0) {	   LOG(L_ERR, "ERROR: TM module: t_lookup_request: too few headers\n");	   T=T_NULL;	   return -1;   }   /* start searching into the table */   hash_index = hash( p_msg->callid->body , get_cseq(p_msg)->number ) ;   if ( p_msg->first_line.u.request.method_value==METHOD_ACK  )      isACK = 1;   DBG("t_lookup_request: continue searching;  hash=%d, isACK=%d\n",hash_index,isACK);   /* all the transactions from the entry are compared */   p_cell     = hash_table->entrys[hash_index].first_cell;   tmp_cell = 0;   while( p_cell )   {      /* the transaction is referenceted for reading */      ref_cell( p_cell );      /* is it the wanted transaction ? */      if ( !isACK )      { /* is not an ACK request */         /* first only the length are checked */         if ( /*from length*/ p_cell->inbound_request->from->body.len == p_msg->from->body.len )            if ( /*to length*/ p_cell->inbound_request->to->body.len == p_msg->to->body.len )               if ( /*callid length*/ p_cell->inbound_request->callid->body.len == p_msg->callid->body.len )                  if ( /*cseq length*/ p_cell->inbound_request->cseq->body.len == p_msg->cseq->body.len )                     /* so far the lengths are the same -> let's check the contents */                        if ( /*from*/ !memcmp( p_cell->inbound_request->from->body.s , p_msg->from->body.s , p_msg->from->body.len ) )                           if ( /*to*/ !memcmp( p_cell->inbound_request->to->body.s , p_msg->to->body.s , p_msg->to->body.len)  )                               if ( /*callid*/ !memcmp( p_cell->inbound_request->callid->body.s , p_msg->callid->body.s , p_msg->callid->body.len ) )                                  if ( /*cseq*/ !memcmp( p_cell->inbound_request->cseq->body.s , p_msg->cseq->body.s , p_msg->cseq->body.len ) )                                     { /* WE FOUND THE GOLDEN EGG !!!! */                                        DBG("DEBUG: t_lookup_request: non-ACK found\n");                                        T = p_cell;                                        unref_cell( p_cell );                                        return 1;                                     }      }      else      { /* it's a ACK request*/         /* first only the length are checked */         if ( /*from length*/ p_cell->inbound_request->from->body.len == p_msg->from->body.len )            //if ( /*to length*/ p_cell->inbound_request->to->body.len == p_msg->to->body.len )               if ( /*callid length*/ p_cell->inbound_request->callid->body.len == p_msg->callid->body.len )                  if ( /*cseq_nr length*/ get_cseq(p_cell->inbound_request)->number.len == get_cseq(p_msg)->number.len )                      if ( /*cseq_method type*/ p_cell->inbound_request->first_line.u.request.method_value == METHOD_INVITE  )                         //if ( /*tag length*/ p_cell->tag &&  p_cell->tag->len==p_msg->tag->body.len )                            /* so far the lengths are the same -> let's check the contents */                            if ( /*from*/ !memcmp( p_cell->inbound_request->from->body.s , p_msg->from->body.s , p_msg->from->body.len ) )                               //if ( /*to*/ !memcmp( p_cell->inbound_request->to->body.s , p_msg->to->body.s , p_msg->to->body.len)  )                                  //if ( /*tag*/ !memcmp( p_cell->tag->s , p_msg->tag->body.s , p_msg->tag->body.len ) )                                     if ( /*callid*/ !memcmp( p_cell->inbound_request->callid->body.s , p_msg->callid->body.s , p_msg->callid->body.len ) )                                        if ( /*cseq_nr*/ !memcmp( get_cseq(p_cell->inbound_request)->number.s , get_cseq(p_msg)->number.s , get_cseq(p_msg)->number.len ) )                                           { /* WE FOUND THE GOLDEN EGG !!!! */                                              DBG("DEBUG: t_lookup_request: ACK found\n");                                              T = p_cell;                                              unref_cell( p_cell );                                               return 1;                                           }      } /* end if is ACK or not*/      /* next transaction */      tmp_cell = p_cell;      p_cell = p_cell->next_cell;      /* the transaction is dereferenceted */      unref_cell( tmp_cell );   }   /* no transaction found */   DBG("DEBUG: t_lookup_request: no transaction found\n");   T = 0;   return -1;}