]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Refactor HS client state-clearing code into a separate function
authorRobert Ransom <rransom.8774@gmail.com>
Thu, 2 Jun 2011 09:57:29 +0000 (02:57 -0700)
committerRobert Ransom <rransom.8774@gmail.com>
Thu, 2 Jun 2011 09:57:29 +0000 (02:57 -0700)
src/or/main.c
src/or/rendclient.c
src/or/rendclient.h

index 3c84ddaa6450a0c1708d01874bc6d28aef5e6a57..bc639dbdd8cd2471eab4e4e9578b60ed352d5b11 100644 (file)
@@ -853,9 +853,7 @@ signewnym_impl(time_t now)
 
   circuit_expire_all_dirty_circs();
   addressmap_clear_transient();
-  rend_cache_purge();
-  rend_client_cancel_descriptor_fetches();
-  rend_client_purge_last_hid_serv_requests();
+  rend_client_purge_state();
   time_of_last_signewnym = now;
   signewnym_is_pending = 0;
 }
index 12b54df0d61ba83af3ef71ae740ebbd11b8961af..329b2567d68e5c75703b1fcf36d1251112c5aaa0 100644 (file)
@@ -27,6 +27,16 @@ static extend_info_t *rend_client_get_random_intro_impl(
                           const rend_cache_entry_t *rend_query,
                           const int strict, const int warnings);
 
+/** Purge all potentially remotely-detectable state held in the hidden
+ * service client code.  Called on SIGNAL NEWNYM. */
+void
+rend_client_purge_state(void)
+{
+  rend_cache_purge();
+  rend_client_cancel_descriptor_fetches();
+  rend_client_purge_last_hid_serv_requests();
+}
+
 /** Called when we've established a circuit to an introduction point:
  * send the introduction request. */
 void
index 2bfc850ad589785c79364dc4dcecc51c4d82611e..c6cf82b3dddef55d5d84279ef1b8e49c0d4328ec 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _TOR_RENDCLIENT_H
 #define _TOR_RENDCLIENT_H
 
+void rend_client_purge_state(void);
+
 void rend_client_introcirc_has_opened(origin_circuit_t *circ);
 void rend_client_rendcirc_has_opened(origin_circuit_t *circ);
 int rend_client_introduction_acked(origin_circuit_t *circ,