[or-cvs] r12496: Initial phase of proposal 110: accept RELAY_EARLY cells, and (in tor/trunk: . doc src/or)

nickm at seul.org nickm at seul.org
Wed Nov 14 20:01:15 UTC 2007


Author: nickm
Date: 2007-11-14 15:01:15 -0500 (Wed, 14 Nov 2007)
New Revision: 12496

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/doc/TODO
   tor/trunk/src/or/command.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/relay.c
Log:
 r16670 at catbus:  nickm | 2007-11-14 14:56:30 -0500
 Initial phase of proposal 110: accept RELAY_EARLY cells, and turn them into RELAY cells when sending them on over a v1 OR connection.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16670] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-11-14 20:01:12 UTC (rev 12495)
+++ tor/trunk/ChangeLog	2007-11-14 20:01:15 UTC (rev 12496)
@@ -7,6 +7,10 @@
     - 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:

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2007-11-14 20:01:12 UTC (rev 12495)
+++ tor/trunk/doc/TODO	2007-11-14 20:01:15 UTC (rev 12496)
@@ -72,8 +72,8 @@
         - 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

Modified: tor/trunk/src/or/command.c
===================================================================
--- tor/trunk/src/or/command.c	2007-11-14 20:01:12 UTC (rev 12495)
+++ tor/trunk/src/or/command.c	2007-11-14 20:01:15 UTC (rev 12496)
@@ -136,6 +136,7 @@
       PROCESS_CELL(created, cell, conn);
       break;
     case CELL_RELAY:
+    case CELL_RELAY_EARLY:
       ++stats_n_relay_cells_processed;
       PROCESS_CELL(relay, cell, conn);
       break;

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-11-14 20:01:12 UTC (rev 12495)
+++ tor/trunk/src/or/or.h	2007-11-14 20:01:15 UTC (rev 12496)
@@ -659,6 +659,7 @@
 #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)

Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c	2007-11-14 20:01:12 UTC (rev 12495)
+++ tor/trunk/src/or/relay.c	2007-11-14 20:01:15 UTC (rev 12496)
@@ -1890,6 +1890,10 @@
     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);
 



More information about the tor-commits mailing list