From: Nick Mathewson Date: Thu, 7 Feb 2013 22:13:51 +0000 (-0500) Subject: Merge remote-tracking branch 'public/easy_ratelim' X-Git-Tag: tor-0.2.4.11-alpha~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3433216268a97f8c1595fd389da0e960e8074d32;p=thirdparty%2Ftor.git Merge remote-tracking branch 'public/easy_ratelim' Conflicts: src/or/connection.c --- 3433216268a97f8c1595fd389da0e960e8074d32 diff --cc src/or/connection.c index d0602fde24,5da4d39ba5..7b0f081fde --- a/src/or/connection.c +++ b/src/or/connection.c @@@ -1444,12 -1441,13 +1444,9 @@@ connection_connect(connection_t *conn, /* We should never even try to connect anyplace if DisableNetwork is set. * Warn if we do, and refuse to make the connection. */ static ratelim_t disablenet_violated = RATELIM_INIT(30*60); - char *m; -#ifdef _WIN32 - *socket_error = WSAENETUNREACH; -#else - *socket_error = ENETUNREACH; -#endif + *socket_error = SOCK_ERRNO(ENETUNREACH); - if ((m = rate_limit_log(&disablenet_violated, approx_time()))) { - log_warn(LD_BUG, "Tried to open a socket with DisableNetwork set.%s", m); - tor_free(m); - } + log_fn_ratelim(&disablenet_violated, LOG_WARN, LD_BUG, + "Tried to open a socket with DisableNetwork set."); tor_fragile_assert(); return -1; }