#include <WebProbe.hpp>
Public Types | |
| using | NotifyCb = std::function<void(const std::string&, const std::string&, bool)> |
Public Member Functions | |
| WebProbe (const std::string &blocklist_path_hint="", int warning_port=81) | |
| ~WebProbe () | |
| std::string | check_url (const std::string &url) |
| void | reload_blocklist (const std::string &path_hint) |
| void | register_callback (NotifyCb cb) |
Private Member Functions | |
| std::string | extract_host (const std::string &raw) |
| std::string | build_local_warning_redirect (const std::string &url) const |
Private Attributes | |
| int | warning_port_ |
| std::shared_mutex | mutex_ |
| NotifyCb | notify_cb_ |
Definition at line 26 of file WebProbe.hpp.
| using WebProbe::NotifyCb = std::function<void(const std::string&, const std::string&, bool)> |
Definition at line 28 of file WebProbe.hpp.
|
explicit |
Definition at line 139 of file WebProbe.cpp.
References load_blocklist(), and warning_port_.
|
default |
References build_local_warning_redirect(), check_url(), extract_host(), register_callback(), and reload_blocklist().
|
private |
Definition at line 178 of file WebProbe.cpp.
References warning_port_.
Referenced by check_url(), and ~WebProbe().
| std::string WebProbe::check_url | ( | const std::string & | url | ) |
Definition at line 185 of file WebProbe.cpp.
References _, build_local_warning_redirect(), extract_host(), g_hot, g_hot_mtx, AsyncDNSResolver::instance(), Backend::instance(), is_blocked_host(), now_ms(), AsyncDNSResolver::resolve_cached(), and TTL_MS.
Referenced by ~WebProbe().
|
private |
Definition at line 147 of file WebProbe.cpp.
References to_ascii_idna().
Referenced by check_url(), and ~WebProbe().
| void WebProbe::register_callback | ( | NotifyCb | cb | ) |
Definition at line 227 of file WebProbe.cpp.
References mutex_, and notify_cb_.
Referenced by ~WebProbe().
| void WebProbe::reload_blocklist | ( | const std::string & | path_hint | ) |
Definition at line 232 of file WebProbe.cpp.
References load_blocklist().
Referenced by ~WebProbe().
|
mutableprivate |
Definition at line 42 of file WebProbe.hpp.
Referenced by register_callback().
|
private |
Definition at line 43 of file WebProbe.hpp.
Referenced by register_callback().
|
private |
Definition at line 41 of file WebProbe.hpp.
Referenced by build_local_warning_redirect(), and WebProbe().