[tor-commits] [tor/master] prop224: Move function move_descriptors() around.

nickm at torproject.org nickm at torproject.org
Mon Sep 4 16:10:48 UTC 2017


commit 17fd2c8a51900bd71eaeff397ec64b6949a51730
Author: George Kadianakis <desnacked at riseup.net>
Date:   Fri Aug 25 16:06:17 2017 +0300

    prop224: Move function move_descriptors() around.
    
    We want to use some static functions so move it below them.
---
 src/or/hs_service.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index f2e07e78c..12410588b 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -73,6 +73,7 @@ static const char address_tld[] = "onion";
 static smartlist_t *hs_service_staging_list;
 
 static void set_descriptor_revision_counter(hs_descriptor_t *hs_desc);
+static void move_descriptors(hs_service_t *src, hs_service_t *dst);
 
 /* Helper: Function to compare two objects in the service map. Return 1 if the
  * two service have the same master public identity key. */
@@ -709,23 +710,6 @@ close_service_circuits(hs_service_t *service)
   close_service_rp_circuits(service);
 }
 
-/* Move descriptor(s) from the src service to the dst service. */
-static void
-move_descriptors(hs_service_t *src, hs_service_t *dst)
-{
-  tor_assert(src);
-  tor_assert(dst);
-
-  if (src->desc_current) {
-    dst->desc_current = src->desc_current;
-    src->desc_current = NULL;
-  }
-  if (src->desc_next) {
-    dst->desc_next = src->desc_next;
-    src->desc_next = NULL;
-  }
-}
-
 /* Move every ephemeral services from the src service map to the dst service
  * map. It is possible that a service can't be register to the dst map which
  * won't stop the process of moving them all but will trigger a log warn. */
@@ -980,6 +964,23 @@ service_descriptor_new(void)
   return sdesc;
 }
 
+/* Move descriptor(s) from the src service to the dst service. */
+static void
+move_descriptors(hs_service_t *src, hs_service_t *dst)
+{
+  tor_assert(src);
+  tor_assert(dst);
+
+  if (src->desc_current) {
+    dst->desc_current = src->desc_current;
+    src->desc_current = NULL;
+  }
+  if (src->desc_next) {
+    dst->desc_next = src->desc_next;
+    src->desc_next = NULL;
+  }
+}
+
 /* From the given service, remove all expired failing intro points for each
  * descriptor. */
 static void





More information about the tor-commits mailing list