| 294 | } |
| 295 | |
| 296 | void 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 | |
| 323 | void reset_host_connect_errors(const char *ip_string) |
| 324 | { |
no test coverage detected