diff options
author | Peter Palfrader <peter@palfrader.org> | 2005-10-17 16:21:42 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2005-10-17 16:21:42 +0000 |
commit | 0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0 (patch) | |
tree | b4e573d9050e828ba4bc6659f3db42f31a4667e7 | |
parent | bec2271029463b426a9c87330ff392b9807d62ec (diff) | |
download | tor-0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0.tar.gz tor-0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0.zip |
Downgrade a few INFO level logs to DEBUG again. Also add two or three new
logs in cases where a calling function's log was downgraded and we wouldn't
get any log message otherwise.
svn:r5263
-rw-r--r-- | src/common/crypto.c | 8 | ||||
-rw-r--r-- | src/common/tortls.c | 2 | ||||
-rw-r--r-- | src/or/command.c | 2 | ||||
-rw-r--r-- | src/or/connection.c | 2 | ||||
-rw-r--r-- | src/or/connection_or.c | 2 | ||||
-rw-r--r-- | src/or/cpuworker.c | 4 | ||||
-rw-r--r-- | src/or/directory.c | 4 | ||||
-rw-r--r-- | src/or/dirserv.c | 3 | ||||
-rw-r--r-- | src/or/onion.c | 8 | ||||
-rw-r--r-- | src/or/router.c | 2 |
10 files changed, 22 insertions, 15 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index bb30fc6614..4ec48ee7da 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -738,7 +738,7 @@ crypto_pk_private_decrypt(crypto_pk_env_t *env, char *to, env->key, crypto_get_rsa_padding(padding)); if (r<0) { - crypto_log_errors(warnOnFailure?LOG_WARN:LOG_INFO, + crypto_log_errors(warnOnFailure?LOG_WARN:LOG_DEBUG, "performing RSA decryption"); return -1; } @@ -942,7 +942,7 @@ crypto_pk_private_hybrid_decrypt(crypto_pk_env_t *env, } outlen = crypto_pk_private_decrypt(env,buf,from,pkeylen,padding,warnOnFailure); if (outlen<0) { - log_fn(warnOnFailure?LOG_WARN:LOG_INFO, "Error decrypting public-key data"); + log_fn(warnOnFailure?LOG_WARN:LOG_DEBUG, "Error decrypting public-key data"); return -1; } if (outlen < CIPHER_KEY_LEN) { @@ -1425,8 +1425,10 @@ crypto_dh_get_public(crypto_dh_env_t *dh, char *pubkey, size_t pubkey_len) tor_assert(dh->dh->pub_key); bytes = BN_num_bytes(dh->dh->pub_key); tor_assert(bytes >= 0); - if (pubkey_len < (size_t)bytes) + if (pubkey_len < (size_t)bytes) { + log_fn(LOG_WARN, "Weird! pubkey_len (%d) was smaller than DH_BYTES (%d)", (int) pubkey_len, bytes); return -1; + } memset(pubkey, 0, pubkey_len); BN_bn2bin(dh->dh->pub_key, (unsigned char*)(pubkey+(pubkey_len-bytes))); diff --git a/src/common/tortls.c b/src/common/tortls.c index 522deb09e0..694060d18d 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -479,7 +479,7 @@ tor_tls_read(tor_tls_t *tls, char *cp, size_t len) r = SSL_read(tls->ssl, cp, len); if (r > 0) return r; - err = tor_tls_get_error(tls, r, CATCH_ZERO, "reading", LOG_INFO); + err = tor_tls_get_error(tls, r, CATCH_ZERO, "reading", LOG_DEBUG); if (err == _TOR_TLS_ZERORETURN) { log_fn(LOG_DEBUG,"read returned r=%d; TLS is closed",r); tls->state = TOR_TLS_ST_CLOSED; diff --git a/src/or/command.c b/src/or/command.c index acb7cda05e..72bcaf5578 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -283,7 +283,7 @@ command_process_relay_cell(cell_t *cell, connection_t *conn) circ = circuit_get_by_circid_orconn(cell->circ_id, conn); if (!circ) { - log_fn(LOG_INFO,"unknown circuit %d on connection from %s:%d. Dropping.", + log_fn(LOG_DEBUG,"unknown circuit %d on connection from %s:%d. Dropping.", cell->circ_id, conn->address, conn->port); return; } diff --git a/src/or/connection.c b/src/or/connection.c index 72e780adc8..6845fa72f9 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1209,7 +1209,7 @@ connection_read_to_buf(connection_t *conn, int *max_to_read) conn->nickname ? conn->nickname : "not set", conn->address); return -1; case TOR_TLS_ERROR: - log_fn(LOG_INFO,"tls error. breaking (nickname %s, address %s).", + log_fn(LOG_DEBUG,"tls error. breaking (nickname %s, address %s).", conn->nickname ? conn->nickname : "not set", conn->address); return -1; case TOR_TLS_WANTWRITE: diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 65217cdc79..c63bf0e4b5 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -172,7 +172,7 @@ connection_or_finished_connecting(connection_t *conn) tor_assert(conn->type == CONN_TYPE_OR); tor_assert(conn->state == OR_CONN_STATE_CONNECTING); - log_fn(LOG_INFO,"OR connect() to router at %s:%u finished.", + log_fn(LOG_DEBUG,"OR connect() to router at %s:%u finished.", conn->address,conn->port); if (get_options()->HttpsProxy) { diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 5208d79397..a6ef430e61 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -163,7 +163,7 @@ connection_cpu_process_inbuf(connection_t *conn) circ = circuit_get_by_circid_orconn(circ_id, p_conn); if (success == 0) { - log_fn(LOG_INFO,"decoding onionskin failed. Closing."); + log_fn(LOG_DEBUG,"decoding onionskin failed. Closing."); if (circ) circuit_mark_for_close(circ); goto done_processing; @@ -266,7 +266,7 @@ cpuworker_main(void *data) if (onion_skin_server_handshake(question, onion_key, last_onion_key, reply_to_proxy, keys, CPATH_KEY_MATERIAL_LEN) < 0) { /* failure */ - log_fn(LOG_INFO,"onion_skin_server_handshake failed."); + log_fn(LOG_DEBUG,"onion_skin_server_handshake failed."); memset(buf,0,LEN_ONION_RESPONSE); /* send all zeros for failure */ } else { /* success */ diff --git a/src/or/directory.c b/src/or/directory.c index ffb51d3a9c..0086a695e7 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -844,7 +844,7 @@ connection_dir_client_reached_eof(connection_t *conn) abs(delta)/60, delta>0 ? "behind" : "ahead"); skewed = 1; /* don't check the recommended-versions line */ } else { - log_fn(LOG_INFO, "Time on received directory is within tolerance; we are %d seconds skewed. (That's okay.)", delta); + log_fn(LOG_DEBUG, "Time on received directory is within tolerance; we are %d seconds skewed. (That's okay.)", delta); } } @@ -1576,7 +1576,7 @@ connection_dir_finished_connecting(connection_t *conn) tor_assert(conn->type == CONN_TYPE_DIR); tor_assert(conn->state == DIR_CONN_STATE_CONNECTING); - log_fn(LOG_INFO,"Dir connection to router %s:%u established.", + log_fn(LOG_DEBUG,"Dir connection to router %s:%u established.", conn->address,conn->port); conn->state = DIR_CONN_STATE_CLIENT_SENDING; /* start flushing conn */ diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 0cc21af97d..79d60dc56e 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1039,7 +1039,8 @@ dirserv_regenerate_directory(void) return -1; } set_cached_dir(&the_directory, new_directory, time(NULL)); - log_fn(LOG_INFO,"New directory (size %d):\n%s",(int)the_directory.dir_len, + log_fn(LOG_INFO,"New directory (size %d) has been built.",(int)the_directory.dir_len); + log_fn(LOG_DEBUG,"New directory (size %d):\n%s",(int)the_directory.dir_len, the_directory.dir); the_directory_is_dirty = 0; diff --git a/src/or/onion.c b/src/or/onion.c index c33f5e1aa4..c6a5909646 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -245,8 +245,10 @@ onion_skin_server_handshake(const char *onion_skin, /* ONIONSKIN_CHALLENGE_LEN b } dh = crypto_dh_new(); - if (crypto_dh_get_public(dh, handshake_reply_out, DH_KEY_LEN)) + if (crypto_dh_get_public(dh, handshake_reply_out, DH_KEY_LEN)) { + log_fn(LOG_INFO, "crypto_dh_get_public failed."); goto err; + } #ifdef DEBUG_ONION_SKINS printf("Server: server g^y:"); @@ -259,8 +261,10 @@ onion_skin_server_handshake(const char *onion_skin, /* ONIONSKIN_CHALLENGE_LEN b key_material = tor_malloc(DIGEST_LEN+key_out_len); len = crypto_dh_compute_secret(dh, challenge, DH_KEY_LEN, key_material, DIGEST_LEN+key_out_len); - if (len < 0) + if (len < 0) { + log_fn(LOG_INFO, "crypto_dh_compute_secret failed."); goto err; + } /* send back H(K|0) as proof that we learned K. */ memcpy(handshake_reply_out+DH_KEY_LEN, key_material, DIGEST_LEN); diff --git a/src/or/router.c b/src/or/router.c index 672709c189..947137af76 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -629,7 +629,7 @@ router_retry_connections(int force) if (force || !connection_get_by_identity_digest(router->identity_digest, CONN_TYPE_OR)) { - log_fn(LOG_INFO,"%sconnecting to %s at %s:%u.", + log_fn(LOG_DEBUG,"%sconnecting to %s at %s:%u.", clique_mode(options) ? "(forced) " : "", router->nickname, router->address, router->or_port); /* Remember when we started trying to determine reachability */ |