summaryrefslogtreecommitdiff
path: root/src/or/rendmid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r--src/or/rendmid.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 23c3deddaa..89739e1291 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -8,10 +8,12 @@
**/
#include "or.h"
+#include "channel.h"
#include "circuitlist.h"
#include "circuituse.h"
#include "config.h"
#include "crypto.h"
+#include "dos.h"
#include "relay.h"
#include "rendmid.h"
#include "rephist.h"
@@ -232,6 +234,16 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
goto err;
}
+ /* Check if we are configured to accept established rendezvous cells from
+ * client or in other words tor2web clients. */
+ if (channel_is_client(circ->p_chan) &&
+ dos_should_refuse_single_hop_client()) {
+ /* Note it down for the heartbeat log purposes. */
+ dos_note_refuse_single_hop_client();
+ /* Silent drop so the client has to time out before moving on. */
+ return 0;
+ }
+
if (circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
"Tried to establish rendezvous on non-edge circuit");