Go to the source code of this file.
Classes | |
| struct | PaymentsCache |
| struct | TriggerState |
Functions | |
| static std::string | home_dir () |
| static fs::path | xdg_data_home () |
| static fs::path | payments_json_user_path () |
| static fs::path | payments_json_system_path () |
| static bool | read_all (const fs::path &p, std::string &out) |
| static bool | write_all_atomic (const fs::path &p, const std::string &data) |
| static std::string | to_lower (std::string s) |
| static std::string | normalize_domain_or_url (std::string in) |
| static void | seed_user_payments_from_system_if_missing () |
| static std::vector< std::string > | load_payments_domains_from_user_json () |
| static std::string | generate_pac (const std::vector< std::string > &pay_domains, const std::string &stub_proxy_host, int stub_proxy_port) |
| static std::string | http_response_200 (const std::string &body, const std::string &content_type) |
| static std::string | http_response_404 () |
| static std::string | http_response_405 () |
| static int | run_trigger_cmd (const std::string &cmd) |
| static bool | wait_backend_up (const std::string &backend_host, int backend_port, int wait_ms) |
| static void | forward_bidirectional (tcp::socket a, tcp::socket b) |
| static void | handle_proxy_client (tcp::socket client, TriggerState &trig, const std::string &trigger_cmd, const std::string &backend_host, int backend_port, int backend_wait_ms) |
| static void | serve_pac_one (tcp::socket sock, PaymentsCache &cache, std::mutex &cache_mtx, const std::string &stub_proxy_host, int stub_proxy_port) |
| int | main (int argc, char **argv) |
|
static |
Definition at line 336 of file BastionGuard-pac.cpp.
References forward_bidirectional().
Referenced by forward_bidirectional(), and handle_proxy_client().
|
static |
Definition at line 222 of file BastionGuard-pac.cpp.
References generate_pac().
Referenced by generate_pac(), and serve_pac_one().
|
static |
Definition at line 368 of file BastionGuard-pac.cpp.
References forward_bidirectional(), handle_proxy_client(), TriggerState::last_start, TriggerState::mtx, run_trigger_cmd(), TriggerState::started, and wait_backend_up().
Referenced by handle_proxy_client(), and main().
|
static |
Definition at line 50 of file BastionGuard-pac.cpp.
References home_dir().
Referenced by home_dir(), and xdg_data_home().
|
static |
Definition at line 270 of file BastionGuard-pac.cpp.
References http_response_200().
Referenced by http_response_200(), and serve_pac_one().
|
static |
Definition at line 283 of file BastionGuard-pac.cpp.
References http_response_404().
Referenced by http_response_404(), and serve_pac_one().
|
static |
Definition at line 294 of file BastionGuard-pac.cpp.
References http_response_405().
Referenced by http_response_405(), and serve_pac_one().
|
static |
Definition at line 191 of file BastionGuard-pac.cpp.
References load_payments_domains_from_user_json(), normalize_domain_or_url(), payments_json_user_path(), and seed_user_payments_from_system_if_missing().
Referenced by load_payments_domains_from_user_json(), and serve_pac_one().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 490 of file BastionGuard-pac.cpp.
References BastionGuard::Platform::cef_available(), handle_proxy_client(), main(), payments_json_user_path(), running, seed_user_payments_from_system_if_missing(), and serve_pac_one().
|
static |
Definition at line 118 of file BastionGuard-pac.cpp.
References normalize_domain_or_url(), and to_lower().
Referenced by load_payments_domains(), load_payments_domains_from_user_json(), normalize_domain_or_url(), normalize_domain_or_url(), and save_payments_domains().
|
static |
Definition at line 70 of file BastionGuard-pac.cpp.
References payments_json_system_path().
Referenced by payments_json_system_path(), and seed_user_payments_from_system_if_missing().
|
static |
Definition at line 64 of file BastionGuard-pac.cpp.
References payments_json_user_path(), and xdg_data_home().
Referenced by load_payments_domains_from_user_json(), main(), payments_json_user_path(), seed_user_payments_from_system_if_missing(), and serve_pac_one().
|
static |
Definition at line 74 of file BastionGuard-pac.cpp.
References read_all().
Referenced by read_all(), and seed_user_payments_from_system_if_missing().
|
static |
Definition at line 306 of file BastionGuard-pac.cpp.
References bg_process::run(), and run_trigger_cmd().
Referenced by handle_proxy_client(), and run_trigger_cmd().
|
static |
Definition at line 150 of file BastionGuard-pac.cpp.
References payments_json_system_path(), payments_json_user_path(), read_all(), seed_user_payments_from_system_if_missing(), and write_all_atomic().
Referenced by load_payments_domains_from_user_json(), main(), seed_user_payments_from_system_if_missing(), and serve_pac_one().
|
static |
Definition at line 431 of file BastionGuard-pac.cpp.
References PaymentsCache::domains, generate_pac(), http_response_200(), http_response_404(), http_response_405(), PaymentsCache::last_mtime, load_payments_domains_from_user_json(), PaymentsCache::loaded, payments_json_user_path(), seed_user_payments_from_system_if_missing(), and serve_pac_one().
Referenced by main(), and serve_pac_one().
|
static |
Definition at line 112 of file BastionGuard-pac.cpp.
References to_lower().
Referenced by clean_domain(), clean_domain(), normalize_domain_or_url(), to_lower(), to_lower(), to_lower(), and to_lower().
|
static |
Definition at line 316 of file BastionGuard-pac.cpp.
References wait_backend_up().
Referenced by handle_proxy_client(), and wait_backend_up().
|
static |
Definition at line 83 of file BastionGuard-pac.cpp.
References write_all_atomic().
Referenced by seed_user_payments_from_system_if_missing(), and write_all_atomic().
|
static |
Definition at line 55 of file BastionGuard-pac.cpp.
References home_dir(), and xdg_data_home().
Referenced by payments_json_user_path(), and xdg_data_home().