Browse Source

presence: query_str filled with value of the corresponding column

- static value was used that made setting of parameter for column names
  not being considered
Daniel-Constantin Mierla 10 years ago
parent
commit
845bdb8884
2 changed files with 4 additions and 2 deletions
  1. 2 1
      modules/presence/presentity.c
  2. 2 1
      modules/presence/publish.c

+ 2 - 1
modules/presence/presentity.c

@@ -885,6 +885,7 @@ int pres_htable_restore(void)
 	int event;
 	event_t ev;
 	char* sphere= NULL;
+	static str query_str;
 
 	result_cols[user_col= n_result_cols++]= &str_username_col;
 	result_cols[domain_col= n_result_cols++]= &str_domain_col;
@@ -899,7 +900,7 @@ int pres_htable_restore(void)
 		goto error;
 	}
 
-	static str query_str = str_init("username");
+	query_str = str_username_col;
 	if (db_fetch_query(&pa_dbf, pres_fetch_rows, pa_db, 0, 0, 0, result_cols,
 				0, n_result_cols, &query_str, &result) < 0)
 	{

+ 2 - 1
modules/presence/publish.c

@@ -70,6 +70,7 @@ void msg_presentity_clean(unsigned int ticks,void *param)
 	int i = 0, num_watchers = 0;
 	presentity_t pres;
 	str uri = {0, 0}, event, *rules_doc = NULL;
+	static str query_str;
 
 	LM_DBG("cleaning expired presentity information\n");
 	if (pa_dbf.use_table(pa_db, &presentity_table) < 0) 
@@ -97,7 +98,7 @@ void msg_presentity_clean(unsigned int ticks,void *param)
 	result_cols[etag_col=n_result_cols++] = &str_etag_col;
 	result_cols[event_col=n_result_cols++] = &str_event_col;
 
-	static str query_str = str_init("username");
+	query_str = str_username_col;
 	if (db_fetch_query(&pa_dbf, pres_fetch_rows, pa_db, db_keys, db_ops,
 				db_vals, result_cols, n_db_cols, n_result_cols,
 				&query_str, &result) < 0)