rem: TRACE_LOG("  created RLS to %.*s from %.*s\n",
add: DEBUG_LOG("  created RLS to %.*s from %.*s\n",
context: int db_load_rls(){	/* this function may be called from mod_init, thus can not work	 * with DB connection opened from child_init */	db_con_t* rls_db = NULL; /* own database connection handle */	int i, r = 0;	rl_subscription_t *s;	db_res_t *res = NULL;	db_key_t result_cols[] = { 		"id", "doc_version", "dialog",		"expires", "status", "contact",		"uri", "package", "w_uri"	};	if (!use_db) return 0;	TRACE_LOG("loading rls from db\n");	/* open own database connection */	if (rls_dbf.init) rls_db = rls_dbf.init(db_url);	if (!rls_db) {		LOG(L_ERR, "db_load_rls: Error while connecting database\n");		return -1;	}	if (rls_dbf.use_table(rls_db, rls_table) < 0) {		LOG(L_ERR, "rls_load_rls: Error in use_table\n");		return -1;	}	if (rls_dbf.query (rls_db, NULL, NULL, NULL,			result_cols, 0, sizeof(result_cols) / sizeof(db_key_t), 			0, &res) < 0) {		LOG(L_ERR, "db_load_rls: Error while querying presentity\n");		r = -1;		res = NULL;	}	if (res) {		for (i = 0; i < res->n; i++) {			db_row_t *row = &res->rows[i];			db_val_t *row_vals = ROW_VALUES(row);			str id = STR_NULL;			str contact = STR_NULL;			str dialog = STR_NULL;			str uri = STR_NULL;			str package = STR_NULL;			str w_uri = STR_NULL;			subscription_status_t status;			time_t expires = 0;			int expires_after;			dlg_t *dlg = NULL;			s = rls_alloc_subscription(rls_external_subscription);			if (!s) { r = -1; break; }						get_str_val(row_vals[0], id);			strcpy(s->dbid, id.s);			get_int_val(row_vals[1], s->doc_version);			get_blob_val(row_vals[2], dialog);			get_time_val(row_vals[3], expires);			get_int_val(row_vals[4], status);			get_str_val(row_vals[5], contact);			get_str_val(row_vals[6], uri);			get_str_val(row_vals[7], package);			get_str_val(row_vals[8], w_uri);			if (expires != 0) expires_after = expires - time(NULL);			else expires_after = 0;			dlg = dlg2str(&dialog);			sm_init_subscription_nolock_ex(rls_manager, &s->external, 					dlg,					status,					&contact,					&uri,					&package,					&w_uri,					expires_after,					s);			TRACE_LOG("  created RLS to %.*s from %.*s\n", 					FMT_STR(uri), FMT_STR(w_uri));					/* load virtual subscriptions */			db_load_vs(rls_db, s);			}		rls_dbf.free_result(rls_db, res);	}		/* close db connection */	if (rls_dbf.close) rls_dbf.close(rls_db);	TRACE_LOG("rls loaded\n");	return r;}