Browse code

perl: update the index of params in action struct

- params start from 3rd position of val array
(cherry picked from commit f624074a1680befed9328548864407c396ec196f)

Daniel-Constantin Mierla authored on 20/04/2010 10:24:29 • Andrei Pelinescu-Onciul committed on 28/05/2010 18:48:24
Showing 1 changed files
... ...
@@ -285,20 +285,20 @@ int moduleFunc(struct sip_msg *m, char *func,
285 285
 		}
286 286
 
287 287
 		if (argc>=2) {
288
-			*retval = exp_func_struct->v1.fixup(&(act->val[2].u.data), 2);
288
+			*retval = exp_func_struct->v1.fixup(&(act->val[3].u.data), 2);
289 289
 			if (*retval < 0) {
290 290
 				LM_ERR("Error in fixup (2)\n");
291 291
 				return -1;
292 292
 			}
293
-			act->val[2].type = MODFIXUP_ST;
293
+			act->val[3].type = MODFIXUP_ST;
294 294
 		}
295 295
 		if (argc>=1) {
296
-			*retval = exp_func_struct->v1.fixup(&(act->val[1].u.data), 1);
296
+			*retval = exp_func_struct->v1.fixup(&(act->val[2].u.data), 1);
297 297
 			if (*retval < 0) {
298 298
 				LM_ERR("Error in fixup (1)\n");
299 299
 				return -1;
300 300
 			}
301
-			act->val[1].type = MODFIXUP_ST;
301
+			act->val[2].type = MODFIXUP_ST;
302 302
 		}
303 303
 		if (argc==0) {
304 304
 			*retval = exp_func_struct->v1.fixup(0, 0);
... ...
@@ -312,14 +312,14 @@ int moduleFunc(struct sip_msg *m, char *func,
312 312
 	init_run_actions_ctx(&ra_ctx);
313 313
 	*retval = do_action(&ra_ctx, act, m);
314 314
 
315
-	if ((act->val[2].type == MODFIXUP_ST) && (act->val[2].u.data)) {
316
-		/* pkg_free(act->elem[2].u.data); */
315
+	if ((act->val[3].type == MODFIXUP_ST) && (act->val[3].u.data)) {
316
+		/* pkg_free(act->elem[3].u.data); */
317 317
 		LM_WARN("moduleFunction: A fixup function was called. "
318 318
 				"This currently creates a memory leak.\n");
319 319
 	}
320 320
 
321
-	if ((act->val[1].type == MODFIXUP_ST) && (act->val[1].u.data)) {
322
-		/* pkg_free(act->elem[1].u.data); */
321
+	if ((act->val[2].type == MODFIXUP_ST) && (act->val[2].u.data)) {
322
+		/* pkg_free(act->elem[2].u.data); */
323 323
 		LM_WARN("moduleFunction: A fixup function was called. "
324 324
 				"This currently creates a memory leak.\n");
325 325
 	}