Changes between Version 2 and Version 3 of Ticket #3521, comment 14


Ignore:
Timestamp:
May 2, 2014, 3:56:57 PM (5 years ago)
Author:
wfn
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3521, comment 14

    v2 v3  
    77> In the future we will also want a command that actually fetches the descriptor even if it's not cached.
    88
    9 I've been tinkering with `or/control.c` to allow for [1]-type of descriptor fetching (cache, network (i.e. "force network refetch" kind of logic.)) But, the "fetch descriptors from directories" logic is asynchronous in nature (because that's the the way it all works (libevent)) (`rend_client_refetch_v2_renddesc()` -> `directory_get_from_hs_dir()` which chooses the dirauth to query, etc., and which in turn calls `directory_initiate_command_routerstatus_rend()` -> `connection_connect()` -> send things, and then register via `connection_watch_events()`, and `connection_start_reading()`). Therefore, implementing a "try to remotely fetch an HS descriptor and return that exact descriptor" type of thing turned out not to be that easy. I suppose one could start from the bottom-up and not use things like `directory_get_from_hs_dir()`, but I'm not sure.
     9I've been tinkering with `or/control.c` to allow for [1]-type of descriptor fetching (cache, network (i.e. "force network refetch" kind of logic.)) But, the "fetch descriptors from directories" logic is asynchronous in nature (because that's the the way it all works (libevent)) (`rend_client_refetch_v2_renddesc()` -> `directory_get_from_hs_dir()` which chooses the dirauth to query, etc., and which in turn calls `directory_initiate_command_routerstatus_rend()` -> `connection_connect()` -> send things, and then register via `connection_watch_events()`, or `connection_start_reading()`).
     10
     11Therefore, implementing a "try to remotely fetch an HS descriptor and return that exact descriptor" type of thing turned out not to be that easy. I suppose one could start from the bottom-up and not use things like `directory_get_from_hs_dir()`, but I'm not sure. The problem is that the "look up HS descriptor cache entry" and "fetch and return HS descriptor" logics are different.
     12
     13Hence it would probably make sense to have two different GETINFO commands: for cache lookup, and for network fetch (the latter would return asynchronously, in a way that `control-spec` allows us to do.) Or, to make it more (e.g. stem-)user-friendly, the GETINFO command could allow for asynchronous response, even for cache-based reply. So if cache was hit, it would return pretty much immediately, but the controlling client should allow for async controller responses.
    1014
    1115This is just in case someone else is considering implementing the same thing. It would be useful for sure.