Separate lookup function for service rend cache

Performing lookups in both the client and service side descriptor
caches from the same rend_cache_lookup_entry() function increases the
risk of accidental API misuse.

I'm separating the lookup functions to keep the caches distinct.
This commit is contained in:
Donncha O'Cearbhaill
2015-09-01 21:19:01 +02:00
parent 61ef356ab3
commit d47a4aec66
5 changed files with 53 additions and 31 deletions
+3 -2
View File
@@ -60,8 +60,9 @@ void rend_cache_clean_v2_descs_as_dir(time_t now, size_t min_to_remove);
void rend_cache_purge(void);
void rend_cache_free_all(void);
int rend_cache_lookup_entry(const char *query, int version,
rend_cache_entry_t **entry_out,
rend_cache_type_t cache);
rend_cache_entry_t **entry_out);
int rend_cache_lookup_v2_desc_as_service(const char *query,
rend_cache_entry_t **entry_out);
int rend_cache_lookup_v2_desc_as_dir(const char *query, const char **desc);
/** Return value from rend_cache_store_v2_desc_as_{dir,client}. */
typedef enum {