|
@@ -11,6 +11,7 @@
|
|
|
#define ROUTER_PRIVATE
|
|
|
#define ROUTERLIST_PRIVATE
|
|
|
#define HIBERNATE_PRIVATE
|
|
|
+#define NETWORKSTATUS_PRIVATE
|
|
|
#include "or.h"
|
|
|
#include "config.h"
|
|
|
#include "directory.h"
|
|
@@ -1014,16 +1015,14 @@ vote_tweaks_for_v3ns(networkstatus_t *v, int voter, time_t now)
|
|
|
/* Monkey around with the list a bit */
|
|
|
vrs = smartlist_get(v->routerstatus_list, 2);
|
|
|
smartlist_del_keeporder(v->routerstatus_list, 2);
|
|
|
- tor_free(vrs->version);
|
|
|
- tor_free(vrs);
|
|
|
+ vote_routerstatus_free(vrs);
|
|
|
vrs = smartlist_get(v->routerstatus_list, 0);
|
|
|
vrs->status.is_fast = 1;
|
|
|
|
|
|
if (voter == 3) {
|
|
|
vrs = smartlist_get(v->routerstatus_list, 0);
|
|
|
smartlist_del_keeporder(v->routerstatus_list, 0);
|
|
|
- tor_free(vrs->version);
|
|
|
- tor_free(vrs);
|
|
|
+ vote_routerstatus_free(vrs);
|
|
|
vrs = smartlist_get(v->routerstatus_list, 0);
|
|
|
memset(vrs->status.descriptor_digest, (int)'Z', DIGEST_LEN);
|
|
|
test_assert(router_add_to_routerlist(
|
|
@@ -1363,7 +1362,8 @@ test_a_networkstatus(
|
|
|
vote->dist_seconds = 300;
|
|
|
authority_cert_free(vote->cert);
|
|
|
vote->cert = authority_cert_dup(cert2);
|
|
|
- vote->net_params = smartlist_new();
|
|
|
+ SMARTLIST_FOREACH(vote->net_params, char *, c, tor_free(c));
|
|
|
+ smartlist_clear(vote->net_params);
|
|
|
smartlist_split_string(vote->net_params, "bar=2000000000 circuitwindow=20",
|
|
|
NULL, 0, 0);
|
|
|
tor_free(vote->client_versions);
|
|
@@ -1407,7 +1407,8 @@ test_a_networkstatus(
|
|
|
vote->dist_seconds = 250;
|
|
|
authority_cert_free(vote->cert);
|
|
|
vote->cert = authority_cert_dup(cert3);
|
|
|
- vote->net_params = smartlist_new();
|
|
|
+ SMARTLIST_FOREACH(vote->net_params, char *, c, tor_free(c));
|
|
|
+ smartlist_clear(vote->net_params);
|
|
|
smartlist_split_string(vote->net_params, "circuitwindow=80 foo=660",
|
|
|
NULL, 0, 0);
|
|
|
smartlist_add(vote->supported_methods, tor_strdup("4"));
|
|
@@ -1984,6 +1985,7 @@ vote_tweaks_for_umbw(networkstatus_t *v, int voter, time_t now)
|
|
|
(void)now;
|
|
|
|
|
|
test_assert(v->supported_methods);
|
|
|
+ SMARTLIST_FOREACH(v->supported_methods, char *, c, tor_free(c));
|
|
|
smartlist_clear(v->supported_methods);
|
|
|
/* Method 17 is MIN_METHOD_TO_CLIP_UNMEASURED_BW_KB */
|
|
|
smartlist_split_string(v->supported_methods,
|