]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r16670@catbus: nickm | 2007-11-14 14:56:30 -0500
authorNick Mathewson <nickm@torproject.org>
Wed, 14 Nov 2007 20:01:15 +0000 (20:01 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 14 Nov 2007 20:01:15 +0000 (20:01 +0000)
 Initial phase of proposal 110: accept RELAY_EARLY cells, and turn them into RELAY cells when sending them on over a v1 OR connection.

svn:r12496

ChangeLog
doc/TODO
src/or/command.c
src/or/or.h
src/or/relay.c

index c7cd26d2cc767b50003d8260d7c843396fd31173..c4c57a89485f4a89ff81135594244e66787eded9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@ Changes in version 0.2.0.12-alpha - 2007-11-??
     - When we're lacking a consensus, don't try to perform rendezvous
       operations.  (Bug spotted by Karsten)
 
+  o Minor features:
+    - When we negotiate a v2 OR connection (not yet implemented), accept
+      RELAY_EARLY cells and turn them into RELAY cells if we've negotiated
+      a v1 connection.  Initial code for proposal 110.
 
 Changes in version 0.2.0.11-alpha - 2007-11-12
   o Security fixes:
index 19b9f82a29735339735e99094b0bcae5ef52af6b..cb0755172d5f1c5981fd621ba65268789871cc5a 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -72,8 +72,8 @@ Things we'd like to do in 0.2.0.x:
         - Don't extend a circuit over a noncanonical connection with
           mismatched address.
         - Learn our outgoing IP address from netinfo cells?
-      - Protocol revision.
-        - Earliest stages of 110 (infinite-length) in v2 protocol:
+      o Protocol revision.
+        o Earliest stages of 110 (infinite-length) in v2 protocol:
           add support for RELAY_EARLY.
   o Before the feature freeze: (Roger)
     o Make tunnelled dir conns use begin_dir if enabled
index 9dc8408a87dcf9ed4aff3ed0ec992c05b351bd8c..b882878ee192f3ddb495b5cf53f15df423534304 100644 (file)
@@ -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;
index 263e7c420a25bb80092416a27894b1d5fd005ca7..a87d95ed7a7e6e666db6c5afe5103c7cf3f0642c 100644 (file)
@@ -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)
index d9ca3760f9a08c9e0ac7c084f3001f714404636b..95d30a98422020095242c90e7c0aebb0d66ce6b5 100644 (file)
@@ -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);