summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-30 14:54:33 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-30 14:54:33 -0500
commitd04f21bf394eb9e1781a89d9827476e13cc11086 (patch)
treede78da1483e0421c73bc9efad042eccd627f572d /src/or/connection_edge.c
parent3b88b638264011158d27d5b451fd07d16f60e16b (diff)
parentdb648fe886fd8ae4f42bb13d0219ca7fa690bdc1 (diff)
downloadtor-d04f21bf394eb9e1781a89d9827476e13cc11086.tar.gz
tor-d04f21bf394eb9e1781a89d9827476e13cc11086.zip
Merge branch 'feature2553-v4-rebased'
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 4fb220642c..aba9ba2727 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1973,6 +1973,14 @@ connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn,
return -1;
}
+ if (options->Tor2webMode) {
+ log_warn(LD_APP, "Refusing to connect to non-hidden-service hostname %s "
+ "because tor2web mode is enabled.",
+ safe_str_client(socks->address));
+ connection_mark_unattached_ap(conn, END_STREAM_REASON_ENTRYPOLICY);
+ return -1;
+ }
+
if (socks->command == SOCKS_COMMAND_RESOLVE) {
uint32_t answer;
struct in_addr in;
@@ -2534,7 +2542,9 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
begin_type = ap_conn->use_begindir ?
RELAY_COMMAND_BEGIN_DIR : RELAY_COMMAND_BEGIN;
if (begin_type == RELAY_COMMAND_BEGIN) {
+#ifndef NON_ANONYMOUS_MODE_ENABLED
tor_assert(circ->build_state->onehop_tunnel == 0);
+#endif
}
if (connection_edge_send_command(edge_conn, begin_type,