aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-09 08:29:21 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-09 08:29:21 -0400
commitfa6b80d6e510dd7027cc2dab50622bad4dc90064 (patch)
treee7e67789cb39400a11f9318472d1c8ed9aa72436 /src
parentaacbf551c459e3bccbd7dec53fcefbceaab98a33 (diff)
parentb0bbe6b2f1d8f0f2c83565f94d8a7dc5c5f72a91 (diff)
downloadtor-fa6b80d6e510dd7027cc2dab50622bad4dc90064.tar
tor-fa6b80d6e510dd7027cc2dab50622bad4dc90064.tar.gz
Merge remote-tracking branch 'public/bug10431'
Diffstat (limited to 'src')
-rwxr-xr-xsrc/or/control.c7
-rw-r--r--src/or/control.h2
-rw-r--r--src/or/or.h4
-rw-r--r--src/test/test_extorport.c2
4 files changed, 12 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 7f421a71d..c91705257 100755
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4887,7 +4887,7 @@ control_event_bootstrap(bootstrap_status_t status, int progress)
*/
MOCK_IMPL(void,
control_event_bootstrap_problem, (const char *warn, int reason,
- const or_connection_t *or_conn))
+ or_connection_t *or_conn))
{
int status = bootstrap_percent;
const char *tag, *summary;
@@ -4898,6 +4898,11 @@ MOCK_IMPL(void,
/* bootstrap_percent must not be in "undefined" state here. */
tor_assert(status >= 0);
+ if (or_conn->have_noted_bootstrap_problem)
+ return;
+
+ or_conn->have_noted_bootstrap_problem = 1;
+
if (bootstrap_percent == 100)
return; /* already bootstrapped; nothing to be done here. */
diff --git a/src/or/control.h b/src/or/control.h
index ce605a120..988c171d7 100644
--- a/src/or/control.h
+++ b/src/or/control.h
@@ -94,7 +94,7 @@ void monitor_owning_controller_process(const char *process_spec);
void control_event_bootstrap(bootstrap_status_t status, int progress);
MOCK_DECL(void, control_event_bootstrap_problem,(const char *warn,
int reason,
- const or_connection_t *or_conn));
+ or_connection_t *or_conn));
void control_event_clients_seen(const char *controller_str);
void control_event_transport_launched(const char *mode,
diff --git a/src/or/or.h b/src/or/or.h
index e17b5816a..19a1c99a9 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1482,6 +1482,10 @@ typedef struct or_connection_t {
unsigned int is_outgoing:1;
unsigned int proxy_type:2; /**< One of PROXY_NONE...PROXY_SOCKS5 */
unsigned int wide_circ_ids:1;
+ /** True iff this connection has had its bootstrap failure logged with
+ * control_event_bootstrap_problem. */
+ unsigned int have_noted_bootstrap_problem:1;
+
uint16_t link_proto; /**< What protocol version are we using? 0 for
* "none negotiated yet." */
diff --git a/src/test/test_extorport.c b/src/test/test_extorport.c
index b34f5e38d..f91ac7415 100644
--- a/src/test/test_extorport.c
+++ b/src/test/test_extorport.c
@@ -364,7 +364,7 @@ test_ext_or_cookie_auth_testvec(void *arg)
static void
ignore_bootstrap_problem(const char *warn, int reason,
- const or_connection_t *conn)
+ or_connection_t *conn)
{
(void)warn;
(void)reason;