Преглед изворни кода

- instead of passing the registerde param, the TM callbacks give you
a pointer to the param. (usefull if you want to change the param value)

Bogdan-Andrei Iancu пре 21 година
родитељ
комит
3c6c6f9c02
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 2 2
      modules/tm/t_hooks.c
  2. 1 1
      modules/tm/t_hooks.h

+ 2 - 2
modules/tm/t_hooks.c

@@ -178,7 +178,7 @@ void run_trans_callbacks( int type , struct cell *trans,
 		if ( (cbp->types)&type ) {
 			DBG("DBG: trans=%p, callback type %d, id %d entered\n",
 				trans, type, cbp->id );
-			params.param = cbp->param;
+			params.param = &(cbp->param);
 			cbp->callback( trans, type, &params );
 		}
 	}
@@ -197,7 +197,7 @@ void run_reqin_callbacks( struct cell *trans, struct sip_msg *req, int code )
 	for (cbp=req_in_tmcb_hl->first; cbp; cbp=cbp->next)  {
 		DBG("DBG: trans=%p, callback type %d, id %d entered\n",
 			trans, cbp->types, cbp->id );
-		params.param = cbp->param;
+		params.param = &(cbp->param);
 		cbp->callback( trans, cbp->types, &params );
 	}
 }

+ 1 - 1
modules/tm/t_hooks.h

@@ -165,7 +165,7 @@ struct tmcb_params {
 	struct sip_msg* req;
 	struct sip_msg* rpl;
 	int code;
-	void *param;
+	void **param;
 };
 
 /* callback function prototype */