File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ using namespace bc::config;
3434
3535// TODO: change to network_address bimap hash table with services and age.
3636hosts::hosts (const settings& settings)
37- : capacity_(std::min(max_address, static_cast <size_t >(
38- settings.host_pool_capacity))),
37+ : capacity_(static_cast <size_t >(settings.host_pool_capacity)),
3938 buffer_ (std::max(capacity_, static_cast <size_t >(1u ))),
4039 stopped_(true ),
4140 file_path_(settings.hosts_file),
@@ -103,8 +102,8 @@ code hosts::fetch(address::list& out) const
103102 if (buffer_.empty ())
104103 return error::not_found;
105104
106- const auto out_count = std::min (buffer_.size (), capacity_) /
107- static_cast <size_t >(pseudo_random::next (5 , 10 ));
105+ const auto out_count = std::min (max_address, std::min ( buffer_.size (),
106+ capacity_) / static_cast <size_t >(pseudo_random::next (5 , 10 ) ));
108107
109108 if (out_count == 0 )
110109 return error::success;
You can’t perform that action at this time.
0 commit comments