aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/command.c1
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/relay.c4
3 files changed, 6 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 9dc8408a8..b882878ee 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -136,6 +136,7 @@ command_process_cell(cell_t *cell, or_connection_t *conn)
PROCESS_CELL(created, cell, conn);
break;
case CELL_RELAY:
+ case CELL_RELAY_EARLY:
++stats_n_relay_cells_processed;
PROCESS_CELL(relay, cell, conn);
break;
diff --git a/src/or/or.h b/src/or/or.h
index 263e7c420..a87d95ed7 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -659,6 +659,7 @@ typedef enum {
#define CELL_NETINFO 8
#define CELL_CERT 9
#define CELL_LINK_AUTH 10
+#define CELL_RELAY_EARLY 11 /*DOCDOC*/
#define CELL_COMMAND_IS_VAR_LENGTH(x) \
((x) == CELL_CERT || (x) == CELL_VERSIONS)
diff --git a/src/or/relay.c b/src/or/relay.c
index d9ca3760f..95d30a984 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1890,6 +1890,10 @@ append_cell_to_circuit_queue(circuit_t *circ, or_connection_t *orconn,
queue = &orcirc->p_conn_cells;
streams_blocked = circ->streams_blocked_on_p_conn;
}
+ if (cell->command == CELL_RELAY_EARLY && orconn->link_proto < 2) {
+ /* V1 connections don't understand RELAY_EARLY. */
+ cell->command = CELL_RELAY;
+ }
cell_queue_append_packed_copy(queue, cell);