From 5854b19816bc7b09df4785afbfb0e8891b398638 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 2 Jun 2016 10:11:29 -0400 Subject: [PATCH 1/2] Use tor_sscanf, not sscanf, in test_util.c. Fixes the 0.2.7 case of bug #19213, which prevented mingw64 from working. --- changes/bug19213 | 3 +++ src/test/test_util.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/bug19213 diff --git a/changes/bug19213 b/changes/bug19213 new file mode 100644 index 000000000..f912ffb0c --- /dev/null +++ b/changes/bug19213 @@ -0,0 +1,3 @@ + o Minor bugfixes (compilation): + - Cause the unit tests to compile correctly on mingw64 versions + that lack sscanf. Fixes bug 19213. Bugfix on 0.2.7.1-alpha. diff --git a/src/test/test_util.c b/src/test/test_util.c index 0a5783e9f..046e92ee1 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -4377,7 +4377,7 @@ test_util_writepid(void *arg) contents = read_file_to_str(fname, 0, NULL); tt_assert(contents); - int n = sscanf(contents, "%lu\n%c", &pid, &c); + int n = tor_sscanf(contents, "%lu\n%c", &pid, &c); tt_int_op(n, OP_EQ, 1); #ifdef _WIN32 From 6eeedc02d8aee0bf1eda8e592764ec9c5df4add7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 2 Jun 2016 10:40:39 -0400 Subject: [PATCH 2/2] Use directory_must_use_begindir to predict we'll surely use begindir Previously, we used !directory_fetches_from_authorities() to predict that we would tunnel connections. But the rules have changed somewhat over the course of 0.2.8 --- changes/bug19191 | 5 +++++ src/or/routerlist.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changes/bug19191 diff --git a/changes/bug19191 b/changes/bug19191 new file mode 100644 index 000000000..8670aaa7f --- /dev/null +++ b/changes/bug19191 @@ -0,0 +1,5 @@ + o Minor bugfixes (downloading): + - Predict more correctly whether we'll be downloading over HTTP when we + determine the maximum length of a URL. This should avoid a "BUG" + warning about the Squid HTTP proxy and its URL limits. Fixes bug 19191; + bugfix on ?????. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index a08b5f319..82376c073 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4674,7 +4674,7 @@ max_dl_per_request(const or_options_t *options, int purpose) } /* If we're going to tunnel our connections, we can ask for a lot more * in a request. */ - if (!directory_fetches_from_authorities(options)) { + if (directory_must_use_begindir(options)) { max = 500; } return max;