Opened 4 months ago

Closed 4 months ago

#22684 closed enhancement (implemented)

Expose we_fetch_{micro,router_}descriptors on control port

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-control, review-group-19
Cc: Actual Points: .1
Parent ID: Points: .1
Reviewer: dgoulet Sponsor:

Description

Right now, stem has some slightly wrong logic:

https://gitweb.torproject.org/stem.git/tree/stem/control.py#n1828

We should make GETINFO commands to fetch these. How about

info/config/we-download-microdescs and 
info/config/we-download-routerdescs

?

Child Tickets

Change History (11)

comment:1 Changed 4 months ago by nickm

Owner: set to nickm
Status: newaccepted

comment:2 Changed 4 months ago by nickm

16:24 < nickm> "info" seems wrong as a prefix; it's all info
16:24 < nickm> and config is already used as a prefix

comment:3 Changed 4 months ago by nickm

Here's the snippet, for when we decide what to name it:

+  } else if (!strcmp(question, "config/we-download-microdescs")) {
+    int r = we_download_microdescriptors(get_options());
+    tor_asprintf(answer, "%d", !!r);
+  } else if (!strcmp(question, "config/we-download-routerdescs")) {
+    int r = we_download_router_descriptors(get_options());
+    tor_asprintf(answer, "%d", !!r);
   }

comment:4 Changed 4 months ago by atagar

Thanks Nick! We already have namespacess for descriptors so how about these?

GETINFO dir/is_available
GETINFO md/is_available

comment:5 Changed 4 months ago by nickm

Maybe dir/download-enabled or md/download-enabled ? To me the name is_available sounds like it's is about whether we have the data right now, not whether we will try to get the data and keep it up to date.

comment:6 Changed 4 months ago by atagar

Sure, those names sound fine to me.

comment:7 Changed 4 months ago by nickm

Actual Points: .1
Status: acceptedneeds_review

See branch ticket22684 in my public tor repository, and branch ticket22684_spec in my public torspec repository.

comment:8 Changed 4 months ago by atagar

Thanks Nick! Both changes look good to me.

comment:9 Changed 4 months ago by nickm

Keywords: review-group-19 added

comment:10 Changed 4 months ago by dgoulet

Reviewer: dgoulet
Status: needs_reviewmerge_ready

lgtm;

comment:11 Changed 4 months ago by nickm

Resolution: implemented
Status: merge_readyclosed

merging!

Note: See TracTickets for help on using tickets.