[sr-dev] git:master: modules_k/rls: Fixed race-condition on multi-server systems that can cause different NOTIFYs with the same CSeq

Peter Dunkley peter.dunkley at crocodile-rcs.com
Mon Sep 17 00:47:54 CEST 2012


Module: sip-router
Branch: master
Commit: 67df57c984e040a948d01d2c6bf1a9461d271f8e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=67df57c984e040a948d01d2c6bf1a9461d271f8e

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Sun Sep 16 23:46:07 2012 +0100

modules_k/rls: Fixed race-condition on multi-server systems that can cause different NOTIFYs with the same CSeq

- Found by Hugh Waite @ Crocodile RCS and fixed by Peter Dunkley @ Crocodile RCS

---

 modules_k/rls/rls_db.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c
index 4ceeba7..86303ad 100644
--- a/modules_k/rls/rls_db.c
+++ b/modules_k/rls/rls_db.c
@@ -884,8 +884,8 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
 
 subs_t *get_dialog_notify_rlsdb(str callid, str to_tag, str from_tag) 
 {
- 	db_key_t query_cols[3];
-	db_val_t query_vals[3];
+ 	db_key_t query_cols[4];
+	db_val_t query_vals[4];
 	db_key_t result_cols[22];
 	int n_query_cols = 0, n_result_cols=0;
 	int r_pres_uri_col,r_to_user_col,r_to_domain_col;
@@ -934,6 +934,12 @@ subs_t *get_dialog_notify_rlsdb(str callid, str to_tag, str from_tag)
 	query_vals[n_query_cols].nul = 0;
 	query_vals[n_query_cols].val.str_val= from_tag;
 	n_query_cols++;
+
+	query_cols[n_query_cols] = &str_updated_col;
+	query_vals[n_query_cols].type = DB1_INT;
+	query_vals[n_query_cols].nul = 0;
+	query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE;
+	n_query_cols++;
 	
 	result_cols[r_pres_uri_col=n_result_cols++] = &str_presentity_uri_col;
 	result_cols[r_to_user_col=n_result_cols++] = &str_to_user_col;




More information about the sr-dev mailing list