mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-25 04:43:31 +01:00
Require explict specification of cache type
This commit is contained in:
parent
293410d138
commit
ee1a4ce8b2
@ -491,6 +491,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e,
|
|||||||
tor_assert(rend_cache_service);
|
tor_assert(rend_cache_service);
|
||||||
tor_assert(rend_cache);
|
tor_assert(rend_cache);
|
||||||
tor_assert(query);
|
tor_assert(query);
|
||||||
|
tor_assert(cache);
|
||||||
|
|
||||||
if (!rend_valid_service_id(query)) {
|
if (!rend_valid_service_id(query)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
@ -506,7 +507,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e,
|
|||||||
default:
|
default:
|
||||||
if(cache == REND_CACHE_TYPE_SERVICE){
|
if(cache == REND_CACHE_TYPE_SERVICE){
|
||||||
entry = strmap_get_lc(rend_cache_service, query);
|
entry = strmap_get_lc(rend_cache_service, query);
|
||||||
} else {
|
} else if (cache == REND_CACHE_TYPE_CLIENT) {
|
||||||
tor_snprintf(key, sizeof(key), "%d%s", default_version, query);
|
tor_snprintf(key, sizeof(key), "%d%s", default_version, query);
|
||||||
entry = strmap_get_lc(rend_cache, key);
|
entry = strmap_get_lc(rend_cache, key);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user