From 7cd9201515f0e23c565ebcf887d437522017016d Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 18 Jun 2009 13:43:29 -0400 Subject: - note whether or not the map is "secure" regardless of whether or not we were able to find a matching key --- src/map.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/map.c') diff --git a/src/map.c b/src/map.c index 2ecf063..95e643c 100644 --- a/src/map.c +++ b/src/map.c @@ -446,11 +446,11 @@ map_match(struct plugin_state *state, if (map == NULL) { return FALSE; } + *secure = map->secure; entry = map_data_find_map_entry(state, map, key_len, key, &key_index); if (entry == NULL) { return FALSE; } - *secure = map->secure; *value_len = entry->value_len[key_index % entry->n_values]; *value = entry->values[key_index % entry->n_values]; *id = entry->id; @@ -483,6 +483,7 @@ map_match_id(struct plugin_state *state, if (map == NULL) { return FALSE; } + *secure = map->secure; entry = map_data_find_map_entry_id(state, map, in_id); if (entry == NULL) { return FALSE; @@ -493,7 +494,6 @@ map_match_id(struct plugin_state *state, if (in_key_index >= entry->n_keys) { return FALSE; } - *secure = map->secure; *key_len = entry->key_len[in_key_index]; *key = entry->keys[in_key_index]; *value_len = entry->value_len[in_key_index % entry->n_values]; @@ -527,11 +527,11 @@ map_first(struct plugin_state *state, if (map == NULL) { return FALSE; } + *secure = map->secure; entry = map->entries; if (entry == NULL) { return FALSE; } - *secure = map->secure; *first_key_len = entry->key_len[0]; *first_key = entry->keys[0]; *first_value_len = entry->value_len[0]; @@ -562,11 +562,11 @@ map_next(struct plugin_state *state, if (map == NULL) { return FALSE; } + *secure = map->secure; entry = map_data_find_map_entry(state, map, prev_len, prev, &key_index); if (entry == NULL) { return FALSE; } - *secure = map->secure; if (key_index + 1 < entry->n_keys) { *next_key_len = entry->key_len[key_index + 1]; *next_key = entry->keys[key_index + 1]; @@ -604,11 +604,11 @@ map_next_id(struct plugin_state *state, if (map == NULL) { return FALSE; } + *secure = map->secure; entry = map_data_find_map_entry_id(state, map, prev_id); if (entry == NULL) { return FALSE; } - *secure = map->secure; if (prev_key_index + 1 < (int) entry->n_keys) { *next_key_len = entry->key_len[prev_key_index + 1]; *next_key = entry->keys[prev_key_index + 1]; -- cgit