!strcasecmp(name, "local") ||
!strcasecmpend(name, ".local");
}
+
/** Longest recognized */
#define MAX_DNS_LABEL_SIZE 63
-#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(0,9,8) && !defined(RUNNING_DOXYGEN)
+#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(0,9,8) && \
+ !defined(RUNNING_DOXYGEN)
/** @{ */
/** On OpenSSL versions before 0.9.8, there is no working SHA256
* implementation, so we use Tom St Denis's nice speedy one, slightly adapted
return the_short_tor_version;
}
-
/** Release additional memory allocated in options
*/
static void
* then we really don't want to try to connect to it. That's
* probably an error. */
if (conn->is_transparent_ap) {
-#define WARN_INTERVAL_LOOP 300
- static ratelim_t loop_warn_limit = RATELIM_INIT(WARN_INTERVAL_LOOP);
+#define WARN_INTRVL_LOOP 300
+ static ratelim_t loop_warn_limit = RATELIM_INIT(WARN_INTRVL_LOOP);
char *m;
if ((m = rate_limit_log(&loop_warn_limit, approx_time()))) {
log_warn(LD_NET,
tor_free(m);
}
} else {
-#define WARN_INTERVAL_PRIV 300
- static ratelim_t priv_warn_limit = RATELIM_INIT(WARN_INTERVAL_PRIV);
+#define WARN_INTRVL_PRIV 300
+ static ratelim_t priv_warn_limit = RATELIM_INIT(WARN_INTRVL_PRIV);
char *m;
if ((m = rate_limit_log(&priv_warn_limit, approx_time()))) {
log_warn(LD_NET,
* 100% true. */
if (buf_datalen(conn->_base.inbuf) > MAX_OR_INBUF_WHEN_NONOPEN) {
log_fn(LOG_PROTOCOL_WARN, LD_NET, "Accumulated too much data (%d bytes) "
- "on nonopen OR connection %s %s:%u in state %s; closing.",
- (int)buf_datalen(conn->_base.inbuf),
- connection_or_nonopen_was_started_here(conn) ? "to" : "from",
- conn->_base.address, conn->_base.port,
- conn_state_to_string(conn->_base.type, conn->_base.state));
+ "on nonopen OR connection %s %s:%u in state %s; closing.",
+ (int)buf_datalen(conn->_base.inbuf),
+ connection_or_nonopen_was_started_here(conn) ? "to" : "from",
+ conn->_base.address, conn->_base.port,
+ conn_state_to_string(conn->_base.type, conn->_base.state));
connection_mark_for_close(TO_CONN(conn));
ret = -1;
}
void
get_platform_str(char *platform, size_t len)
{
- tor_snprintf(platform, len, "Tor %s on %s", get_short_version(), get_uname());
+ tor_snprintf(platform, len, "Tor %s on %s",
+ get_short_version(), get_uname());
}
/* XXX need to audit this thing and count fenceposts. maybe
/* What fraction of desired server descriptors do we need before we will
* build circuits? */
-#define FRACTION_USABLE_NEEDED .75
+#define FRAC_USABLE_NEEDED .75
/* What fraction of desired _exit_ server descriptors do we need before we
* will build circuits? */
-#define FRACTION_EXIT_USABLE_NEEDED .5
+#define FRAC_EXIT_USABLE_NEEDED .5
- if (num_present < num_usable * FRACTION_USABLE_NEEDED) {
+ if (num_present < num_usable * FRAC_USABLE_NEEDED) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
"We have only %d/%d usable %sdescriptors.",
num_present, num_usable, using_md ? "micro" : "");
num_present, using_md ? "micro" : "", num_present ? "" : "s");
res = 0;
goto done;
- } else if (num_exit_present < num_exit_usable * FRACTION_EXIT_USABLE_NEEDED) {
+ } else if (num_exit_present < num_exit_usable * FRAC_EXIT_USABLE_NEEDED) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
"We have only %d/%d usable exit node descriptors.",
num_exit_present, num_exit_usable);