mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
reindent cell_queues_check_size()
This commit is contained in:
parent
c2e200cef8
commit
cacea9102a
1 changed files with 13 additions and 13 deletions
|
@ -2451,20 +2451,20 @@ cell_queues_check_size(void)
|
||||||
alloc += rend_cache_total;
|
alloc += rend_cache_total;
|
||||||
if (alloc >= get_options()->MaxMemInQueues_low_threshold) {
|
if (alloc >= get_options()->MaxMemInQueues_low_threshold) {
|
||||||
last_time_under_memory_pressure = approx_time();
|
last_time_under_memory_pressure = approx_time();
|
||||||
if (alloc >= get_options()->MaxMemInQueues) {
|
if (alloc >= get_options()->MaxMemInQueues) {
|
||||||
/* If we're spending over 20% of the memory limit on hidden service
|
/* If we're spending over 20% of the memory limit on hidden service
|
||||||
* descriptors, free them until we're down to 10%.
|
* descriptors, free them until we're down to 10%.
|
||||||
*/
|
*/
|
||||||
if (rend_cache_total > get_options()->MaxMemInQueues / 5) {
|
if (rend_cache_total > get_options()->MaxMemInQueues / 5) {
|
||||||
const size_t bytes_to_remove =
|
const size_t bytes_to_remove =
|
||||||
rend_cache_total - (get_options()->MaxMemInQueues / 10);
|
rend_cache_total - (get_options()->MaxMemInQueues / 10);
|
||||||
rend_cache_clean_v2_descs_as_dir(time(NULL), bytes_to_remove);
|
rend_cache_clean_v2_descs_as_dir(time(NULL), bytes_to_remove);
|
||||||
alloc -= rend_cache_total;
|
alloc -= rend_cache_total;
|
||||||
alloc += rend_cache_get_total_allocation();
|
alloc += rend_cache_get_total_allocation();
|
||||||
|
}
|
||||||
|
circuits_handle_oom(alloc);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
circuits_handle_oom(alloc);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue