[or-cvs] fix some bugs; more remain

Roger Dingledine arma at seul.org
Sat Apr 3 00:55:55 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	circuit.c connection.c connection_edge.c or.h rendclient.c 
Log Message:
fix some bugs; more remain


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -d -r1.174 -r1.175
--- circuit.c	2 Apr 2004 23:54:48 -0000	1.174
+++ circuit.c	3 Apr 2004 00:55:53 -0000	1.175
@@ -334,7 +334,7 @@
  * the list.
  */
 circuit_t *circuit_get_next_by_pk_and_purpose(circuit_t *start,
-                                         const char *digest, int purpose)
+                                         const char *digest, uint8_t purpose)
 {
   circuit_t *circ;
   if (start == NULL)

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -d -r1.190 -r1.191
--- connection.c	30 Mar 2004 22:57:49 -0000	1.190
+++ connection.c	3 Apr 2004 00:55:53 -0000	1.191
@@ -1026,8 +1026,9 @@
   } else {
     assert(!conn->socks_request);
   }
-  if(conn->type != CONN_TYPE_DIR) {
-    assert(!conn->purpose); /* only used for dir types currently */
+  if(conn->type != CONN_TYPE_DIR &&
+     conn->type != CONN_TYPE_AP) {
+    assert(!conn->purpose); /* only used for dir and ap types currently */
   }
 
   switch(conn->type)

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- connection_edge.c	2 Apr 2004 23:54:48 -0000	1.129
+++ connection_edge.c	3 Apr 2004 00:55:53 -0000	1.130
@@ -817,8 +817,9 @@
       /* is one already on the way? */
       circ = circuit_launch_new(desired_circuit_purpose, NULL);
       /* depending on purpose, store stuff into circ */
-      if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_GENERAL ||
-          desired_circuit_purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND) {
+      if(circ &&
+         (desired_circuit_purpose == CIRCUIT_PURPOSE_C_GENERAL ||
+          desired_circuit_purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND)) {
         /* then write the service_id into circ */
         strcpy(circ->rend_query, conn->rend_query);
       }
@@ -964,6 +965,7 @@
   }
 
   conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
+  conn->purpose = AP_PURPOSE_GENERAL;
   connection_start_reading(conn);
 
   /* attaching to a dirty circuit is fine */

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -d -r1.286 -r1.287
--- or.h	2 Apr 2004 23:54:48 -0000	1.286
+++ or.h	3 Apr 2004 00:55:53 -0000	1.287
@@ -176,7 +176,7 @@
 #define AP_PURPOSE_RENDDESC_WAIT 2
 #define AP_PURPOSE_RENDPOINT_WAIT 3
 #define AP_PURPOSE_INTROPOINT_WAIT 4
-#define _AP_PURPOSE_MAX 3
+#define _AP_PURPOSE_MAX 4
 
 #define _DIR_CONN_STATE_MIN 1
 #define DIR_CONN_STATE_CONNECTING 1
@@ -699,7 +699,7 @@
 circuit_t *circuit_get_newest(connection_t *conn,
                               int must_be_open, uint8_t conn_purpose);
 circuit_t *circuit_get_next_by_pk_and_purpose(circuit_t *circuit,
-                                             const char *servid, int purpose);
+                                              const char *servid, uint8_t purpose);
 circuit_t *circuit_get_rendezvous(const char *cookie);
 
 void circuit_expire_building(void);

Index: rendclient.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendclient.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rendclient.c	2 Apr 2004 23:54:48 -0000	1.3
+++ rendclient.c	3 Apr 2004 00:55:53 -0000	1.4
@@ -9,7 +9,7 @@
 rend_client_introcirc_is_ready(connection_t *apconn, circuit_t *circ)
 {
 
-
+  log_fn(LOG_WARN,"introcirc is ready");
 }
 
 /* send the rendezvous cell */
@@ -18,6 +18,7 @@
 {
 
 
+  log_fn(LOG_WARN,"rendcirc is ready");
 }
 
 /* bob sent us a rendezvous cell, join the circs. */



More information about the tor-commits mailing list