Merge branch 'maint-0.3.3' into release-0.3.3
This commit is contained in:
commit
08fca9414d
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfixes (relay, crash):
|
||||||
|
- Avoid a crash when running with DirPort set but ORPort tuned off.
|
||||||
|
Fixes a case of bug 23693; bugfix on 0.3.1.1-alpha.
|
||||||
|
|
|
@ -2180,9 +2180,16 @@ options_act(const or_options_t *old_options)
|
||||||
if (transition_affects_workers) {
|
if (transition_affects_workers) {
|
||||||
log_info(LD_GENERAL,
|
log_info(LD_GENERAL,
|
||||||
"Worker-related options changed. Rotating workers.");
|
"Worker-related options changed. Rotating workers.");
|
||||||
|
const int server_mode_turned_on =
|
||||||
|
server_mode(options) && !server_mode(old_options);
|
||||||
|
const int dir_server_mode_turned_on =
|
||||||
|
dir_server_mode(options) && !dir_server_mode(old_options);
|
||||||
|
|
||||||
if (server_mode(options) && !server_mode(old_options)) {
|
if (server_mode_turned_on || dir_server_mode_turned_on) {
|
||||||
cpu_init();
|
cpu_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (server_mode_turned_on) {
|
||||||
ip_address_changed(0);
|
ip_address_changed(0);
|
||||||
if (have_completed_a_circuit() || !any_predicted_circuits(time(NULL)))
|
if (have_completed_a_circuit() || !any_predicted_circuits(time(NULL)))
|
||||||
inform_testing_reachability();
|
inform_testing_reachability();
|
||||||
|
@ -4749,7 +4756,8 @@ options_transition_affects_workers(const or_options_t *old_options,
|
||||||
YES_IF_CHANGED_LINELIST(Logs);
|
YES_IF_CHANGED_LINELIST(Logs);
|
||||||
|
|
||||||
if (server_mode(old_options) != server_mode(new_options) ||
|
if (server_mode(old_options) != server_mode(new_options) ||
|
||||||
public_server_mode(old_options) != public_server_mode(new_options))
|
public_server_mode(old_options) != public_server_mode(new_options) ||
|
||||||
|
dir_server_mode(old_options) != dir_server_mode(new_options))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Nothing that changed matters. */
|
/* Nothing that changed matters. */
|
||||||
|
|
|
@ -2677,7 +2677,7 @@ do_main_loop(void)
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
directory_info_has_arrived(now, 1, 0);
|
directory_info_has_arrived(now, 1, 0);
|
||||||
|
|
||||||
if (server_mode(get_options())) {
|
if (server_mode(get_options()) || dir_server_mode(get_options())) {
|
||||||
/* launch cpuworkers. Need to do this *after* we've read the onion key. */
|
/* launch cpuworkers. Need to do this *after* we've read the onion key. */
|
||||||
cpu_init();
|
cpu_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,8 @@ get_onion_key(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Store a full copy of the current onion key into *<b>key</b>, and a full
|
/** Store a full copy of the current onion key into *<b>key</b>, and a full
|
||||||
* copy of the most recent onion key into *<b>last</b>.
|
* copy of the most recent onion key into *<b>last</b>. Store NULL into
|
||||||
|
* a pointer if the corresponding key does not exist.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dup_onion_keys(crypto_pk_t **key, crypto_pk_t **last)
|
dup_onion_keys(crypto_pk_t **key, crypto_pk_t **last)
|
||||||
|
@ -139,8 +140,10 @@ dup_onion_keys(crypto_pk_t **key, crypto_pk_t **last)
|
||||||
tor_assert(key);
|
tor_assert(key);
|
||||||
tor_assert(last);
|
tor_assert(last);
|
||||||
tor_mutex_acquire(key_lock);
|
tor_mutex_acquire(key_lock);
|
||||||
tor_assert(onionkey);
|
if (onionkey)
|
||||||
*key = crypto_pk_copy_full(onionkey);
|
*key = crypto_pk_copy_full(onionkey);
|
||||||
|
else
|
||||||
|
*last = NULL;
|
||||||
if (lastonionkey)
|
if (lastonionkey)
|
||||||
*last = crypto_pk_copy_full(lastonionkey);
|
*last = crypto_pk_copy_full(lastonionkey);
|
||||||
else
|
else
|
||||||
|
@ -207,10 +210,14 @@ construct_ntor_key_map(void)
|
||||||
{
|
{
|
||||||
di_digest256_map_t *m = NULL;
|
di_digest256_map_t *m = NULL;
|
||||||
|
|
||||||
|
if (!tor_mem_is_zero((const char*)
|
||||||
|
curve25519_onion_key.pubkey.public_key,
|
||||||
|
CURVE25519_PUBKEY_LEN)) {
|
||||||
dimap_add_entry(&m,
|
dimap_add_entry(&m,
|
||||||
curve25519_onion_key.pubkey.public_key,
|
curve25519_onion_key.pubkey.public_key,
|
||||||
tor_memdup(&curve25519_onion_key,
|
tor_memdup(&curve25519_onion_key,
|
||||||
sizeof(curve25519_keypair_t)));
|
sizeof(curve25519_keypair_t)));
|
||||||
|
}
|
||||||
if (!tor_mem_is_zero((const char*)
|
if (!tor_mem_is_zero((const char*)
|
||||||
last_curve25519_onion_key.pubkey.public_key,
|
last_curve25519_onion_key.pubkey.public_key,
|
||||||
CURVE25519_PUBKEY_LEN)) {
|
CURVE25519_PUBKEY_LEN)) {
|
||||||
|
|
Loading…
Reference in New Issue