From bf4eedbe7105c69369873b64bf90c69470010370 Mon Sep 17 00:00:00 2001 From: Miraty Date: Sun, 23 Apr 2023 17:08:42 +0200 Subject: [PATCH] Add 10ms delay after reloading Tor --- pg-act/ht/add-onion.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pg-act/ht/add-onion.php b/pg-act/ht/add-onion.php index 03e94f5..3b62e86 100644 --- a/pg-act/ht/add-onion.php +++ b/pg-act/ht/add-onion.php @@ -19,7 +19,9 @@ exec(CONF['ht']['sudo_path'] . ' ' . CONF['ht']['tor_reload_cmd'], result_code: if ($code !== 0) output(500, 'Failed to reload Tor.'); -// Get the address generated by Tor +usleep(10000); + +// Get the hostname generated by Tor $onion = exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['tor_user'] . ' ' . CONF['ht']['cat_path'] . ' ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'] . '/hostname'); if (preg_match('/^[0-9a-z]{56}\.onion$/D', $onion) !== 1) output(500, 'No onion address found.');