summaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-12 10:30:54 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-12 10:30:54 -0400
commit8eef7fc845d76da287dd0888b6753178118f7193 (patch)
tree3746384bd89a2ea1e90f30ea5f16e7400bf9f80a /src/or/channel.c
parent5238210da4a830ae3c5837dc903f1f115788949c (diff)
parentbefddf6d2a46cd25beeb46357bf6cc4fe21802ce (diff)
downloadtor-8eef7fc845d76da287dd0888b6753178118f7193.tar.gz
tor-8eef7fc845d76da287dd0888b6753178118f7193.zip
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 9f8a03683f..56eeccc2a7 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -65,6 +65,8 @@
#include "routerlist.h"
#include "scheduler.h"
#include "compat_time.h"
+#include "networkstatus.h"
+#include "rendservice.h"
/* Global lists of channels */
@@ -2731,12 +2733,25 @@ channel_do_open_actions(channel_t *chan)
/* Disable or reduce padding according to user prefs. */
if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
if (!get_options()->ConnectionPadding) {
+ /* Disable if torrc disabled */
channelpadding_disable_padding_on_channel(chan);
- }
-
- /* Padding can be forced and/or reduced by clients, regardless of if
- * the channel supports it */
- if (get_options()->ReducedConnectionPadding) {
+ } else if (get_options()->Tor2webMode &&
+ !networkstatus_get_param(NULL,
+ CHANNELPADDING_TOR2WEB_PARAM,
+ CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1)) {
+ /* Disable if we're using tor2web and the consensus disabled padding
+ * for tor2web */
+ channelpadding_disable_padding_on_channel(chan);
+ } else if (rend_service_allow_non_anonymous_connection(get_options()) &&
+ !networkstatus_get_param(NULL,
+ CHANNELPADDING_SOS_PARAM,
+ CHANNELPADDING_SOS_DEFAULT, 0, 1)) {
+ /* Disable if we're using RSOS and the consensus disabled padding
+ * for RSOS*/
+ channelpadding_disable_padding_on_channel(chan);
+ } else if (get_options()->ReducedConnectionPadding) {
+ /* Padding can be forced and/or reduced by clients, regardless of if
+ * the channel supports it */
channelpadding_reduce_padding_on_channel(chan);
}
}