diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/err/torerr.c | 1 | ||||
-rw-r--r-- | src/or/dirserv.c | 2 | ||||
-rw-r--r-- | src/or/networkstatus.c | 7 | ||||
-rw-r--r-- | src/test/test_dir.c | 14 | ||||
-rw-r--r-- | src/test/test_geoip.c | 8 |
5 files changed, 18 insertions, 14 deletions
diff --git a/src/lib/err/torerr.c b/src/lib/err/torerr.c index 81f3605964..8d8f694f1d 100644 --- a/src/lib/err/torerr.c +++ b/src/lib/err/torerr.c @@ -15,6 +15,7 @@ #include <stdarg.h> #include <stdlib.h> #include <string.h> +#include <stdio.h> #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 655c13326b..693160e80c 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -51,7 +51,7 @@ /** * \file dirserv.c * \brief Directory server core implementation. Manages directory - * contents and generates directories. + * contents and generates directory documents. * * This module implements most of directory cache functionality, and some of * the directory authority functionality. The directory.c module delegates diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index e6eaffffad..b12846197c 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -606,8 +606,11 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, char *tmp = smartlist_join_strings(list_good, " ", 0, NULL); smartlist_add_asprintf(sl, "A consensus needs %d good signatures from recognized " - "authorities for us to accept it. This one has %d (%s).", - n_required, n_good, tmp); + "authorities for us to accept it. " + "This %s one has %d (%s).", + n_required, + networkstatus_get_flavor_name(consensus->flavor), + n_good, tmp); tor_free(tmp); if (n_no_signature) { tmp = smartlist_join_strings(list_no_signature, " ", 0, NULL); diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 9578ba1d33..f98afcaa2c 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -1654,13 +1654,13 @@ test_dir_dirserv_read_measured_bandwidths(void *arg) char *fname = tor_strdup(get_fname("V3BandwidthsFile")); /* Test Torflow file only with timestamp*/ - tor_asprintf(&content, "%ld", timestamp); + tor_asprintf(&content, "%ld", (long)timestamp); write_str_to_file(fname, content, 0); tor_free(content); tt_int_op(-1, OP_EQ, dirserv_read_measured_bandwidths(fname, NULL)); /* Test Torflow file with timestamp followed by '\n' */ - tor_asprintf(&content, "%ld\n", timestamp); + tor_asprintf(&content, "%ld\n", (long)timestamp); write_str_to_file(fname, content, 0); tor_free(content); tt_int_op(0, OP_EQ, dirserv_read_measured_bandwidths(fname, NULL)); @@ -1673,7 +1673,7 @@ test_dir_dirserv_read_measured_bandwidths(void *arg) "pid_bw=57136645 pid_delta=2.12168374577 circ_fail=0.2 " "scanner=/filepath\n"; - tor_asprintf(&content, "%ld\n%s", timestamp, torflow_relay_lines); + tor_asprintf(&content, "%ld\n%s", (long)timestamp, torflow_relay_lines); write_str_to_file(fname, content, 0); tor_free(content); tt_int_op(0, OP_EQ, dirserv_read_measured_bandwidths(fname, NULL)); @@ -1687,14 +1687,14 @@ test_dir_dirserv_read_measured_bandwidths(void *arg) "earliest_bandwidth=2018-05-08T16:13:26\n" "====\n"; - tor_asprintf(&content, "%ld\n%s%s", timestamp, v110_header_lines, + tor_asprintf(&content, "%ld\n%s%s", (long)timestamp, v110_header_lines, torflow_relay_lines); write_str_to_file(fname, content, 0); tor_free(content); tt_int_op(0, OP_EQ, dirserv_read_measured_bandwidths(fname, NULL)); /* Test Torflow with additional headers afer a correct bw line */ - tor_asprintf(&content, "%ld\n%s%s", timestamp, torflow_relay_lines, + tor_asprintf(&content, "%ld\n%s%s", (long)timestamp, torflow_relay_lines, v110_header_lines); write_str_to_file(fname, content, 0); tor_free(content); @@ -1702,7 +1702,7 @@ test_dir_dirserv_read_measured_bandwidths(void *arg) /* Test Torflow with additional headers afer a correct bw line and more * bw lines after the headers. */ - tor_asprintf(&content, "%ld\n%s%s%s", timestamp, torflow_relay_lines, + tor_asprintf(&content, "%ld\n%s%s%s", (long)timestamp, torflow_relay_lines, v110_header_lines, torflow_relay_lines); write_str_to_file(fname, content, 0); tor_free(content); @@ -1714,7 +1714,7 @@ test_dir_dirserv_read_measured_bandwidths(void *arg) "master_key_ed25519=YaqV4vbvPYKucElk297eVdNArDz9HtIwUoIeo0+cVIpQ " "bw=760 nick=Test rtt=380 time=2018-05-08T16:13:26\n"; - tor_asprintf(&content, "%ld\n%s%s", timestamp, v110_header_lines, + tor_asprintf(&content, "%ld\n%s%s", (long)timestamp, v110_header_lines, sbws_relay_lines); write_str_to_file(fname, content, 0); tor_free(content); diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c index c1fcd52c9a..d50dd134e0 100644 --- a/src/test/test_geoip.c +++ b/src/test/test_geoip.c @@ -415,7 +415,7 @@ test_geoip_load_file(void *arg) geoip_db_digest(AF_INET)); const char *fname = get_fname("geoip"); - tt_int_op(0, OP_EQ, write_str_to_file(fname, GEOIP_CONTENT, 0)); + tt_int_op(0, OP_EQ, write_str_to_file(fname, GEOIP_CONTENT, 1)); int rv = geoip_load_file(AF_INET, fname); if (rv != 0) { @@ -491,7 +491,7 @@ test_geoip6_load_file(void *arg) "2001:4878:12a::,2001:4878:203:ffff:ffff:ffff:ffff:ffff,US\n" "2001:4878:204::,2001:4878:204:ffff:ffff:ffff:ffff:ffff,DE\n" "2001:4878:205::,2001:4878:214:ffff:ffff:ffff:ffff:ffff,US\n"; - tt_int_op(0, OP_EQ, write_str_to_file(fname6, CONTENT, 0)); + tt_int_op(0, OP_EQ, write_str_to_file(fname6, CONTENT, 1)); tt_int_op(0, OP_EQ, geoip_load_file(AF_INET6, fname6)); @@ -541,8 +541,8 @@ test_geoip_load_2nd_file(void *arg) char *fname_geoip = tor_strdup(get_fname("geoip_data")); char *fname_empty = tor_strdup(get_fname("geoip_empty")); - tt_int_op(0, OP_EQ, write_str_to_file(fname_geoip, GEOIP_CONTENT, 0)); - tt_int_op(0, OP_EQ, write_str_to_file(fname_empty, "\n", 0)); + tt_int_op(0, OP_EQ, write_str_to_file(fname_geoip, GEOIP_CONTENT, 1)); + tt_int_op(0, OP_EQ, write_str_to_file(fname_empty, "\n", 1)); /* Load 1st geoip file */ tt_int_op(0, OP_EQ, geoip_load_file(AF_INET, fname_geoip)); |