Ticket #20082: 0001-Make-separate-initial-descriptor-post-delay-for-ephe.patch

File 0001-Make-separate-initial-descriptor-post-delay-for-ephe.patch, 2.1 KB (added by twim, 3 years ago)
  • src/or/rendservice.c

    From 2cb2f31e02a904105a88ce1dd3ebdb91172a5091 Mon Sep 17 00:00:00 2001
    From: Ivan Markin <twim@riseup.net>
    Date: Mon, 5 Sep 2016 23:52:57 +0000
    Subject: [PATCH] Make separate initial descriptor post delay for ephemeral
     services. Set it to 3sec.
    
    ---
     src/or/rendservice.c | 15 ++++++++++++---
     1 file changed, 12 insertions(+), 3 deletions(-)
    
    diff --git a/src/or/rendservice.c b/src/or/rendservice.c
    index 12af748..72e769f 100644
    a b rend_consider_services_intro_points(void) 
    36303630
    36313631#define MIN_REND_INITIAL_POST_DELAY (30)
    36323632#define MIN_REND_INITIAL_POST_DELAY_TESTING (5)
     3633#define MIN_REND_EPHEMERAL_INITIAL_POST_DELAY (3)
     3634#define MIN_REND_EPHEMERAL_INITIAL_POST_DELAY_TESTING (1)
    36333635
    36343636/** Regenerate and upload rendezvous service descriptors for all
    36353637 * services, if necessary. If the descriptor has been dirty enough
    rend_consider_services_upload(time_t now) 
    36453647  int i;
    36463648  rend_service_t *service;
    36473649  int rendpostperiod = get_options()->RendPostPeriod;
    3648   int rendinitialpostdelay = (get_options()->TestingTorNetwork ?
    3649                               MIN_REND_INITIAL_POST_DELAY_TESTING :
    3650                               MIN_REND_INITIAL_POST_DELAY);
     3650  int rendinitialpostdelay;
    36513651
    36523652  for (i=0; i < smartlist_len(rend_service_list); ++i) {
    36533653    service = smartlist_get(rend_service_list, i);
     3654    if (service->directory == NULL) { /* Ephemeral service */
     3655      rendinitialpostdelay = (get_options()->TestingTorNetwork ?
     3656                              MIN_REND_EPHEMERAL_INITIAL_POST_DELAY_TESTING :
     3657                              MIN_REND_EPHEMERAL_INITIAL_POST_DELAY);
     3658    } else { /* Non-ephemeral service */
     3659      rendinitialpostdelay = (get_options()->TestingTorNetwork ?
     3660                              MIN_REND_INITIAL_POST_DELAY_TESTING :
     3661                              MIN_REND_INITIAL_POST_DELAY);
     3662    }
    36543663    if (!service->next_upload_time) { /* never been uploaded yet */
    36553664      /* The fixed lower bound of rendinitialpostdelay seconds ensures that
    36563665       * the descriptor is stable before being published. See comment below. */