mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'maint-0.2.9' into release-0.2.9
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
o Minor bugfixes (hidden service v2):
|
||||
- When reloading tor (HUP) configured with hidden service(s), some
|
||||
information weren't copy to the new service object. One problem with this
|
||||
was that tor would wait at least the RendPostPeriod time before uploading
|
||||
the descriptor if the reload happened before the descriptor needed to be
|
||||
published. Fixes bug 23790; bugfix on 0.2.1.9-alpha.
|
||||
@@ -0,0 +1,7 @@
|
||||
o Minor bugfixes (single onion services):
|
||||
- Allow connections to single onion services to remain idle without
|
||||
being disconnected. Relays acting as rendezvous points for
|
||||
single onion services were mistakenly closing idle established
|
||||
rendezvous circuits after 60 seconds, thinking that they are unused
|
||||
directory-fetching circuits that had served their purpose. Fixes
|
||||
bug 29665; bugfix on 0.2.1.26.
|
||||
+4
-1
@@ -1379,10 +1379,13 @@ circuit_expire_old_circuits_serverside(time_t now)
|
||||
or_circ = TO_OR_CIRCUIT(circ);
|
||||
/* If the circuit has been idle for too long, and there are no streams
|
||||
* on it, and it ends here, and it used a create_fast, mark it for close.
|
||||
*
|
||||
* Also if there is a rend_splice on it, it's a single onion service
|
||||
* circuit and we should not close it.
|
||||
*/
|
||||
if (or_circ->is_first_hop && !circ->n_chan &&
|
||||
!or_circ->n_streams && !or_circ->resolving_streams &&
|
||||
or_circ->p_chan &&
|
||||
or_circ->p_chan && !or_circ->rend_splice &&
|
||||
channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
|
||||
log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
|
||||
(unsigned)or_circ->p_circ_id,
|
||||
|
||||
@@ -532,6 +532,30 @@ rend_service_check_dir_and_add(smartlist_t *service_list,
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy relevant data from service src to dst while pruning the service lists.
|
||||
* This should only be called during the pruning process which takes existing
|
||||
* services and copy their data to the newly configured services. The src
|
||||
* service replaycache will be set to NULL after this call. */
|
||||
static void
|
||||
copy_service_on_prunning(rend_service_t *dst, rend_service_t *src)
|
||||
{
|
||||
tor_assert(dst);
|
||||
tor_assert(src);
|
||||
|
||||
/* Keep the timestamps for when the content changed and the next upload
|
||||
* time so we can properly upload the descriptor if needed for the new
|
||||
* service object. */
|
||||
dst->desc_is_dirty = src->desc_is_dirty;
|
||||
dst->next_upload_time = src->next_upload_time;
|
||||
/* Move the replaycache to the new object. */
|
||||
dst->accepted_intro_dh_parts = src->accepted_intro_dh_parts;
|
||||
src->accepted_intro_dh_parts = NULL;
|
||||
/* Copy intro point information to destination service. */
|
||||
dst->intro_period_started = src->intro_period_started;
|
||||
dst->n_intro_circuits_launched = src->n_intro_circuits_launched;
|
||||
dst->n_intro_points_wanted = src->n_intro_points_wanted;
|
||||
}
|
||||
|
||||
/** Set up rend_service_list, based on the values of HiddenServiceDir and
|
||||
* HiddenServicePort in <b>options</b>. Return 0 on success and -1 on
|
||||
* failure. (If <b>validate_only</b> is set, parse, warn and return as
|
||||
@@ -812,6 +836,9 @@ rend_config_services(const or_options_t *options, int validate_only)
|
||||
smartlist_add_all(new->expiring_nodes, old->expiring_nodes);
|
||||
smartlist_clear(old->expiring_nodes);
|
||||
smartlist_add(surviving_services, old);
|
||||
|
||||
/* Copy service flags to the new service object. */
|
||||
copy_service_on_prunning(new, old);
|
||||
break;
|
||||
}
|
||||
} SMARTLIST_FOREACH_END(old);
|
||||
|
||||
Reference in New Issue
Block a user