diff options
author | Roger Dingledine <arma@torproject.org> | 2006-10-23 10:16:43 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-10-23 10:16:43 +0000 |
commit | 77c8c0ee5158643960cbb6d3e30f11f3508f2481 (patch) | |
tree | 0601f95dd07db0afd9765a404fb1de8c2ab5917e /src | |
parent | c0b0f96fce542d6cc0692eee525dfb7620dd036c (diff) | |
download | tor-77c8c0ee5158643960cbb6d3e30f11f3508f2481.tar tor-77c8c0ee5158643960cbb6d3e30f11f3508f2481.tar.gz |
spec and implement some more status events. start to build
some conventions.
svn:r8805
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitbuild.c | 14 | ||||
-rw-r--r-- | src/or/main.c | 1 | ||||
-rw-r--r-- | src/or/routerlist.c | 10 |
3 files changed, 17 insertions, 8 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 3b33bdfba..3268d6d3c 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -652,14 +652,14 @@ circuit_send_next_onion_skin(origin_circuit_t *circ) void circuit_note_clock_jumped(int seconds_elapsed) { - if (server_mode(get_options())) - log(LOG_WARN, LD_GENERAL, - "Please report: your clock just jumped %d seconds forward; " - "assuming established circuits no longer work.", seconds_elapsed); - else - log(LOG_NOTICE, LD_GENERAL, "Your clock just jumped %d seconds forward; " - "assuming established circuits no longer work.", seconds_elapsed); + int severity = server_mode(get_options()) ? LOG_WARN : LOG_NOTICE; + log(severity, LD_GENERAL, "Your clock just jumped %d seconds forward; " + "assuming established circuits no longer work.", seconds_elapsed); + control_event_general_status(LOG_WARN, "CLOCK_JUMPED TIME=%d", + seconds_elapsed); has_completed_circuit=0; /* so it'll log when it works again */ + control_event_client_status(severity, "CIRCUIT_NOT_ESTABLISHED REASON=%s", + "CLOCK_JUMPED"); circuit_mark_all_unused_circs(); circuit_expire_all_dirty_circs(); } diff --git a/src/or/main.c b/src/or/main.c index 87dd579b2..30d5fcc58 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -563,6 +563,7 @@ directory_all_unreachable(time_t now) connection_mark_unattached_ap(edge_conn, END_STREAM_REASON_NET_UNREACHABLE); } + control_event_general_status(LOG_ERR, "DIR_ALL_UNREACHABLE"); } /** This function is called whenever we successfully pull down some new diff --git a/src/or/routerlist.c b/src/or/routerlist.c index f63d41f7a..d469db808 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3080,6 +3080,9 @@ routers_update_all_from_networkstatus(void) n_versioning-n_recommended, n_versioning, n_versioning/2, n_versioning/2 > 1 ? "ies" : "y", rec); have_warned_about_new_version = 1; + control_event_general_status(LOG_WARN, "DANGEROUS_VERSION " + "CURRENT=%s REASON=%s RECOMMENDED=\"%s\"", + VERSION, "NEW", rec); tor_free(rec); } } else { @@ -3092,6 +3095,9 @@ routers_update_all_from_networkstatus(void) n_versioning-n_recommended, n_versioning, n_versioning/2, n_versioning/2 > 1 ? "ies" : "y", rec); have_warned_about_old_version = 1; + control_event_general_status(LOG_WARN, "DANGEROUS_VERSION " + "CURRENT=%s REASON=%s RECOMMENDED=\"%s\"", + VERSION, consensus == VS_OLD ? "OLD" : "UNRECOMMENDED", rec); tor_free(rec); } } else { @@ -3980,14 +3986,16 @@ update_router_have_minimum_dir_info(void) if (res && !have_min_dir_info) { log(LOG_NOTICE, LD_DIR, "We now have enough directory information to build circuits."); + control_event_client_status(LOG_NOTICE, "ENOUGH_DIR_INFO"); } if (!res && have_min_dir_info) { log(LOG_NOTICE, LD_DIR,"Our directory information is no longer up-to-date " "enough to build circuits.%s", num_running > 2 ? "" : " (Not enough servers seem reachable -- " "is your network connection down?)"); + control_event_client_status(LOG_NOTICE, "NOT_ENOUGH_DIR_INFO"); } - need_to_update_have_min_dir_info = 0; + need_to_update_have_min_dir_info = 0; /* XXX redundant */ have_min_dir_info = res; } |