summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c14
-rw-r--r--src/or/ntmain.c1
-rw-r--r--src/or/or.h3
-rw-r--r--src/or/reasons.c2
-rw-r--r--src/test/test.c2
-rw-r--r--src/test/test_util.c34
-rw-r--r--src/win32/orconfig.h2
7 files changed, 53 insertions, 5 deletions
diff --git a/src/or/config.c b/src/or/config.c
index d020c889c8..7ad272f74c 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1255,8 +1255,9 @@ options_act(or_options_t *old_options)
/* How long should we delay counting bridge stats after becoming a bridge?
* We use this so we don't count people who used our bridge thinking it is
* a relay. If you change this, don't forget to change the log message
- * below. */
-#define RELAY_BRIDGE_STATS_DELAY (2 * 60 * 60)
+ * below. It's 4 hours (the time it takes to stop being used by clients)
+ * plus some extra time for clock skew. */
+#define RELAY_BRIDGE_STATS_DELAY (6 * 60 * 60)
if (! bool_eq(options->BridgeRelay, old_options->BridgeRelay)) {
int was_relay = 0;
@@ -1268,7 +1269,7 @@ options_act(or_options_t *old_options)
}
geoip_bridge_stats_init(int_start);
log_info(LD_CONFIG, "We are acting as a bridge now. Starting new "
- "GeoIP stats interval%s.", was_relay ? " in 2 "
+ "GeoIP stats interval%s.", was_relay ? " in 6 "
"hours from now" : "");
} else {
geoip_bridge_stats_term();
@@ -3500,6 +3501,13 @@ options_validate(or_options_t *old_options, or_options_t *options,
"upgrade your Tor controller as soon as possible.");
}
+ if (options->CookieAuthFileGroupReadable && !options->CookieAuthFile) {
+ log_warn(LD_CONFIG, "You set the CookieAuthFileGroupReadable but did "
+ "not configure a the path for the cookie file via "
+ "CookieAuthFile. This means your cookie will not be group "
+ "readable.");
+ }
+
if (options->UseEntryGuards && ! options->NumEntryGuards)
REJECT("Cannot enable UseEntryGuards with NumEntryGuards set to 0");
diff --git a/src/or/ntmain.c b/src/or/ntmain.c
index 9bcb7047eb..7163f5c9a7 100644
--- a/src/or/ntmain.c
+++ b/src/or/ntmain.c
@@ -7,6 +7,7 @@
#include "or.h"
#include "config.h"
#include "main.h"
+#include "ntmain.h"
#ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h>
diff --git a/src/or/or.h b/src/or/or.h
index e6307e3eea..48641c8115 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -59,6 +59,9 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
diff --git a/src/or/reasons.c b/src/or/reasons.c
index db0f2e9345..ade9a3abfc 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -168,7 +168,7 @@ errno_to_stream_end_reason(int e)
S_CASE(ENOTCONN):
S_CASE(ENETUNREACH):
return END_STREAM_REASON_INTERNAL;
- E_CASE(EHOSTUNREACH):
+ S_CASE(EHOSTUNREACH):
/* XXXX022
* The correct behavior is END_STREAM_REASON_NOROUTE, but older
* clients don't recognize it. So we're going to continue sending
diff --git a/src/test/test.c b/src/test/test.c
index 16ac1e4a67..d9528328b8 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -107,6 +107,8 @@ get_fname(const char *name)
{
static char buf[1024];
setup_directory();
+ if (!name)
+ return temp_dir;
tor_snprintf(buf,sizeof(buf),"%s/%s",temp_dir,name);
return buf;
}
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 22f2707d75..8a13597978 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -1106,6 +1106,39 @@ test_util_asprintf(void *ptr)
tor_free(cp2);
}
+static void
+test_util_listdir(void *ptr)
+{
+ smartlist_t *dir_contents = NULL;
+ char *fname1=NULL, *fname2=NULL, *dirname=NULL;
+ (void)ptr;
+
+ fname1 = tor_strdup(get_fname("hopscotch"));
+ fname2 = tor_strdup(get_fname("mumblety-peg"));
+ dirname = tor_strdup(get_fname(NULL));
+
+ tt_int_op(write_str_to_file(fname1, "X\n", 0), ==, 0);
+ tt_int_op(write_str_to_file(fname2, "Y\n", 0), ==, 0);
+
+ dir_contents = tor_listdir(dirname);
+ tt_assert(dir_contents);
+ /* make sure that each filename is listed. */
+ tt_assert(smartlist_string_isin_case(dir_contents, "hopscotch"));
+ tt_assert(smartlist_string_isin_case(dir_contents, "mumblety-peg"));
+
+ tt_assert(!smartlist_string_isin(dir_contents, "."));
+ tt_assert(!smartlist_string_isin(dir_contents, ".."));
+
+ done:
+ tor_free(fname1);
+ tor_free(fname2);
+ tor_free(dirname);
+ if (dir_contents) {
+ SMARTLIST_FOREACH(dir_contents, char *, cp, tor_free(cp));
+ smartlist_free(dir_contents);
+ }
+}
+
#define UTIL_LEGACY(name) \
{ #name, legacy_test_helper, 0, &legacy_setup, test_util_ ## name }
@@ -1128,6 +1161,7 @@ struct testcase_t util_tests[] = {
UTIL_LEGACY(strtok),
UTIL_TEST(find_str_at_start_of_line, 0),
UTIL_TEST(asprintf, 0),
+ UTIL_TEST(listdir, 0),
END_OF_TESTCASES
};
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 78e713f4c9..427ca01ae9 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -233,5 +233,5 @@
#define USING_TWOS_COMPLEMENT
/* Version number of package */
-#define VERSION "0.2.2.14-alpha-dev"
+#define VERSION "0.2.2.15-alpha-dev"