[sr-dev] git:4.0: pipelimit: avoid double locking when changing pipe via mi

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 11 14:37:32 CEST 2013


Module: sip-router
Branch: 4.0
Commit: 5e11ebf34bd525f02c7ff08b9520382c3aaf00f2
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5e11ebf34bd525f02c7ff08b9520382c3aaf00f2

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Jul 11 14:32:48 2013 +0200

pipelimit: avoid double locking when changing pipe via mi

- reported by Krischan Udelhoven, FS#315

(cherry picked from commit 04fd56dc1b84b70a04438ccbf719eb85177524ad)

---

 modules/pipelimit/pl_ht.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/pipelimit/pl_ht.c b/modules/pipelimit/pl_ht.c
index 1146468..a6b9b8a 100644
--- a/modules/pipelimit/pl_ht.c
+++ b/modules/pipelimit/pl_ht.c
@@ -566,16 +566,15 @@ struct mi_root* mi_set_pipe(struct mi_root* cmd_tree, void* param)
 	it->algo = algo_id;
 	it->limit = limit;
 
+	pl_pipe_release(&pipeid);
+
 	if (check_feedback_setpoints(0)) {
-		pl_pipe_release(&pipeid);
 		LM_ERR("feedback limits don't match\n");
 		goto error;
 	} else {
 		*_pl_pid_setpoint = 0.01 * (double)_pl_cfg_setpoint;
 	}
 
-	pl_pipe_release(&pipeid);
-
 	return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
 error:
 	return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);




More information about the sr-dev mailing list