diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-26 11:07:15 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-12-26 11:07:15 -0500 |
commit | a7334f5122046b55a5eff425cdaaa3e56c5defed (patch) | |
tree | 22fc6bbfb9eafbff43f285963b4edf81ec969603 /src/or/buffers.c | |
parent | f269e0f9a51ecc7f22e62bde302afd8574d2f96f (diff) | |
download | tor-a7334f5122046b55a5eff425cdaaa3e56c5defed.tar.gz tor-a7334f5122046b55a5eff425cdaaa3e56c5defed.zip |
Use log_fn_ratelim in a few places.
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 3a1b4d54f8..4d4c879627 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -1505,22 +1505,19 @@ log_unsafe_socks_warning(int socks_protocol, const char *address, static ratelim_t socks_ratelim = RATELIM_INIT(SOCKS_WARN_INTERVAL); const or_options_t *options = get_options(); - char *m = NULL; if (! options->WarnUnsafeSocks) return; - if (safe_socks || (m = rate_limit_log(&socks_ratelim, approx_time()))) { - log_warn(LD_APP, + if (safe_socks) { + log_fn_ratelim(&socks_ratelim, LOG_WARN, LD_APP, "Your application (using socks%d to port %d) is giving " "Tor only an IP address. Applications that do DNS resolves " "themselves may leak information. Consider using Socks4A " "(e.g. via privoxy or socat) instead. For more information, " "please see https://wiki.torproject.org/TheOnionRouter/" - "TorFAQ#SOCKSAndDNS.%s%s", + "TorFAQ#SOCKSAndDNS.%s", socks_protocol, (int)port, - safe_socks ? " Rejecting." : "", - m ? m : ""); - tor_free(m); + safe_socks ? " Rejecting." : ""); } control_event_client_status(LOG_WARN, "DANGEROUS_SOCKS PROTOCOL=SOCKS%d ADDRESS=%s:%d", |