MCPcopy Create free account
hub / github.com/MariaDB/server / inc_host_errors

Function inc_host_errors

sql/hostname.cc:296–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void inc_host_errors(const char *ip_string, Host_errors *errors)
297{
298 if (!ip_string)
299 return;
300
301 ulonglong now= my_hrtime().val;
302 char ip_key[HOST_ENTRY_KEY_SIZE];
303 prepare_hostname_cache_key(ip_string, ip_key);
304
305 mysql_mutex_lock(&hostname_cache->lock);
306
307 Host_entry *entry= hostname_cache_search(ip_key);
308
309 if (entry)
310 {
311 if (entry->m_host_validated)
312 errors->sum_connect_errors();
313 else
314 errors->clear_connect_errors();
315
316 entry->m_errors.aggregate(errors);
317 entry->set_error_timestamps(now);
318 }
319
320 mysql_mutex_unlock(&hostname_cache->lock);
321}
322
323void reset_host_connect_errors(const char *ip_string)
324{

Callers 6

acl_check_hostFunction · 0.85
do_auth_onceFunction · 0.85
acl_authenticateFunction · 0.85

Calls 7

my_hrtimeFunction · 0.85
hostname_cache_searchFunction · 0.85
sum_connect_errorsMethod · 0.80
clear_connect_errorsMethod · 0.80
set_error_timestampsMethod · 0.80
aggregateMethod · 0.45

Tested by

no test coverage detected