diff --git a/src/ssb.c b/src/ssb.c index fdd2e43a..4c5bd740 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2948,7 +2948,10 @@ void tf_ssb_connect(tf_ssb_t* ssb, const char* host, int port, const uint8_t* ke }; char id[k_id_base64_len] = { 0 }; tf_ssb_id_bin_to_str(id, sizeof(id), key); - tf_ssb_connections_store(ssb->connections_tracker, host, port, id); + if ((connect_flags & k_tf_ssb_connect_flag_do_not_store) == 0) + { + tf_ssb_connections_store(ssb->connections_tracker, host, port, id); + } snprintf(connect->host, sizeof(connect->host), "%s", host); memcpy(connect->key, key, k_id_bin_len); tf_ssb_ref(ssb); diff --git a/src/ssb.connections.c b/src/ssb.connections.c index 185dff28..b6eabcca 100644 --- a/src/ssb.connections.c +++ b/src/ssb.connections.c @@ -103,7 +103,7 @@ static void _tf_ssb_connections_get_next_after_work(tf_ssb_t* ssb, int status, v uint8_t key_bin[k_id_bin_len]; if (tf_ssb_id_str_to_bin(key_bin, next->key)) { - tf_ssb_connect(ssb, next->host, next->port, key_bin, 0, NULL, NULL); + tf_ssb_connect(ssb, next->host, next->port, key_bin, k_tf_ssb_connect_flag_do_not_store, NULL, NULL); } } tf_free(next); @@ -287,7 +287,7 @@ static void _tf_ssb_connections_sync_broadcast_visit( } else { - tf_ssb_connect(ssb, host, ntohs(addr->sin_port), pub, k_tf_ssb_connect_flag_one_shot, NULL, NULL); + tf_ssb_connect(ssb, host, ntohs(addr->sin_port), pub, k_tf_ssb_connect_flag_one_shot | k_tf_ssb_connect_flag_do_not_store, NULL, NULL); } } diff --git a/src/ssb.h b/src/ssb.h index ccd6183d..c0a7a282 100644 --- a/src/ssb.h +++ b/src/ssb.h @@ -71,6 +71,7 @@ typedef enum _tf_ssb_message_flags_t typedef enum _tf_ssb_connect_flags_t { k_tf_ssb_connect_flag_one_shot = 0x1, + k_tf_ssb_connect_flag_do_not_store = 0x2, } tf_ssb_connect_flags_t; /** An SSB instance. */