Browse code

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

Peter Dunkley authored on 16/09/2012 22:46:07
Showing 1 changed files
... ...
@@ -884,8 +884,8 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
884 884
 
885 885
 subs_t *get_dialog_notify_rlsdb(str callid, str to_tag, str from_tag) 
886 886
 {
887
- 	db_key_t query_cols[3];
888
-	db_val_t query_vals[3];
887
+ 	db_key_t query_cols[4];
888
+	db_val_t query_vals[4];
889 889
 	db_key_t result_cols[22];
890 890
 	int n_query_cols = 0, n_result_cols=0;
891 891
 	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)
934 934
 	query_vals[n_query_cols].nul = 0;
935 935
 	query_vals[n_query_cols].val.str_val= from_tag;
936 936
 	n_query_cols++;
937
+
938
+	query_cols[n_query_cols] = &str_updated_col;
939
+	query_vals[n_query_cols].type = DB1_INT;
940
+	query_vals[n_query_cols].nul = 0;
941
+	query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE;
942
+	n_query_cols++;
937 943
 	
938 944
 	result_cols[r_pres_uri_col=n_result_cols++] = &str_presentity_uri_col;
939 945
 	result_cols[r_to_user_col=n_result_cols++] = &str_to_user_col;