Merge remote-tracking branch 'public/bug10431'

This commit is contained in:
Nick Mathewson 2014-04-09 08:29:21 -04:00
commit fa6b80d6e5
5 changed files with 17 additions and 3 deletions

5
changes/bug10431 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- Only report the first fatal boostrap error on a given OR
connection. This prevents controllers from declaring that a
connection has failed because of "DONE" or other junk reasons.
Fixes bug 10431; bugfix on 0.2.1.1-alpha.

View File

@ -4887,7 +4887,7 @@ control_event_bootstrap(bootstrap_status_t status, int progress)
*/ */
MOCK_IMPL(void, MOCK_IMPL(void,
control_event_bootstrap_problem, (const char *warn, int reason, control_event_bootstrap_problem, (const char *warn, int reason,
const or_connection_t *or_conn)) or_connection_t *or_conn))
{ {
int status = bootstrap_percent; int status = bootstrap_percent;
const char *tag, *summary; const char *tag, *summary;
@ -4898,6 +4898,11 @@ MOCK_IMPL(void,
/* bootstrap_percent must not be in "undefined" state here. */ /* bootstrap_percent must not be in "undefined" state here. */
tor_assert(status >= 0); tor_assert(status >= 0);
if (or_conn->have_noted_bootstrap_problem)
return;
or_conn->have_noted_bootstrap_problem = 1;
if (bootstrap_percent == 100) if (bootstrap_percent == 100)
return; /* already bootstrapped; nothing to be done here. */ return; /* already bootstrapped; nothing to be done here. */

View File

@ -94,7 +94,7 @@ void monitor_owning_controller_process(const char *process_spec);
void control_event_bootstrap(bootstrap_status_t status, int progress); void control_event_bootstrap(bootstrap_status_t status, int progress);
MOCK_DECL(void, control_event_bootstrap_problem,(const char *warn, MOCK_DECL(void, control_event_bootstrap_problem,(const char *warn,
int reason, 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_clients_seen(const char *controller_str);
void control_event_transport_launched(const char *mode, void control_event_transport_launched(const char *mode,

View File

@ -1482,6 +1482,10 @@ typedef struct or_connection_t {
unsigned int is_outgoing:1; unsigned int is_outgoing:1;
unsigned int proxy_type:2; /**< One of PROXY_NONE...PROXY_SOCKS5 */ unsigned int proxy_type:2; /**< One of PROXY_NONE...PROXY_SOCKS5 */
unsigned int wide_circ_ids:1; 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 uint16_t link_proto; /**< What protocol version are we using? 0 for
* "none negotiated yet." */ * "none negotiated yet." */

View File

@ -364,7 +364,7 @@ test_ext_or_cookie_auth_testvec(void *arg)
static void static void
ignore_bootstrap_problem(const char *warn, int reason, ignore_bootstrap_problem(const char *warn, int reason,
const or_connection_t *conn) or_connection_t *conn)
{ {
(void)warn; (void)warn;
(void)reason; (void)reason;