summaryrefslogtreecommitdiff
path: root/src/or/hs_service.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-25 16:06:17 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-08-25 17:18:05 +0300
commit17fd2c8a51900bd71eaeff397ec64b6949a51730 (patch)
treeb25d310d602cf57a3e8e9b3b6bc110cf351f7124 /src/or/hs_service.c
parenta9fb97e91aa6232619d9e0b81c47e4eb3037d0f7 (diff)
downloadtor-17fd2c8a51900bd71eaeff397ec64b6949a51730.tar.gz
tor-17fd2c8a51900bd71eaeff397ec64b6949a51730.zip
prop224: Move function move_descriptors() around.
We want to use some static functions so move it below them.
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r--src/or/hs_service.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index f2e07e78c7..12410588b5 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