rem: rmv_from_timer_list( &(tr->timeout) );
context: void *server_worker(void *attr){	str               buf;	AAAMessage        *msg;	struct aaa_module *mod;	struct trans      *tr;	struct peer       *in_peer;	while (1) {		/* read a mesage from the queue */		if (get_from_queue( &buf, &in_peer )==-1) {			usleep(500);			continue;		}		/* parse the message */		msg = AAATranslateMessage( buf.s, buf.len );		if (!msg) {			LOG(L_ERR,"ERROR:server_worker: dropping message!\n");			shm_free( buf.s );			continue;		}		/* process the message */		if ( is_req(msg) ) {			/* request*/			msg->in_peer = in_peer;			DBG(" ******** request received!!! \n");			/* sanity checks */			if (msg->commandCode==274 || msg->commandCode==258 ||			msg->commandCode==275 ) {				LOG(L_ERR,"ERROR:server_worker: request 274(ASR)/258(RAR)/"					"275(275) received - unsupported -> droping!\n");				send_error_reply( msg, AAA_COMMAND_UNSUPPORTED);				AAAFreeMessage( &msg );				continue;			}			if (!msg->sessionId || !msg->orig_host || !msg->orig_realm ||			!msg->dest_realm) {				LOG(L_ERR,"ERROR:server_worker: message without sessionId/"					"OriginHost/OriginRealm/DestinationRealm AVP received "					"-> droping!\n");				send_error_reply( msg, AAA_MISSING_AVP);				AAAFreeMessage( &msg );				continue;			}			/* process the request */			process_incoming_request( msg, in_peer);		} else {				DBG(" ******** response received!!! \n");			/* response -> performe transaction lookup and remove it from 			 * hash table */			tr = transaction_lookup(in_peer,msg->endtoendId,msg->hopbyhopId);			if (!tr) {				LOG(L_ERR,"ERROR:server_worker: unexpected answer received "					"(without sending any request)!\n");				AAAFreeMessage( &msg  );				continue;			}			/* stop the transaction timeout */			rmv_from_timer_list( &(tr->timeout) );			/* process the reply */			if (tr->in_peer) {					DBG(" ******** doing downstream forward!!! \n");				/* I have to forward the reply downstream */				msg->hopbyhopId = tr->orig_hopbyhopId;				((unsigned int*)msg->buf.s)[3] = tr->orig_hopbyhopId;				/* is there some module interested in this reply ? */				mod = find_module(msg->applicationId);				if (mod && mod->exports->flags&RUN_ON_REPLIES) {					DBG(" ******* running module (%p) for reply \n",mod);					mod->exports->mod_msg( msg, 0);				}				/* send the rely */				if (send_res_to_peer( &msg->buf, tr->in_peer)==-1) {					LOG(L_ERR,"ERROR:server_worker: forwarding reply "						"failed\n");				}			} else {				/* look like being a reply to a local request */				LOG(L_ERR,"BUG:server_worker: some reply to a local request "					"received; but I don't send requests!!!!\n");			}			/* destroy the transaction */			destroy_transaction( tr );		}		/* free the mesage (along with the buffer) */		AAAFreeMessage( &msg  );	}	return 0;}