Browse Source

make rend apconn send to the right cpath layer

and fix circuit_log_path to know about rend circs


svn:r1496
Roger Dingledine 21 years ago
parent
commit
2bb18e62cb
3 changed files with 8 additions and 4 deletions
  1. 5 1
      src/or/circuit.c
  2. 1 1
      src/or/command.c
  3. 2 2
      src/or/rendclient.c

+ 5 - 1
src/or/circuit.c

@@ -944,7 +944,11 @@ void circuit_log_path(int severity, circuit_t *circ) {
       snprintf(s, sizeof(buf) - (s - buf), "%s(%s) ",
                router->nickname, states[hop->state]);
     } else {
-      snprintf(s, sizeof(buf) - (s - buf), "UNKNOWN ");
+      if(circ->purpose == CIRCUIT_PURPOSE_C_REND_JOINED) {
+        snprintf(s, sizeof(buf) - (s - buf), "(rend join)");
+      } else {
+        snprintf(s, sizeof(buf) - (s - buf), "UNKNOWN ");
+      }
     }
     hop=hop->next;
   } while(hop!=circ->cpath);

+ 1 - 1
src/or/command.c

@@ -193,7 +193,7 @@ static void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
     return;
   }
 
-  log_fn(LOG_DEBUG,"Received for circID %d.",cell->circ_id);
+  log_fn(LOG_INFO,"Received for circID %d.",cell->circ_id);
   if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
     onion_pending_remove(circ);
   }

+ 2 - 2
src/or/rendclient.c

@@ -163,8 +163,6 @@ rend_client_receive_rendezvous(circuit_t *circ, const char *request, int request
   connection_t *apconn;
   crypt_path_t *hop;
   char keys[DIGEST_LEN+CPATH_KEY_MATERIAL_LEN];
-  char buf[DIGEST_LEN+9];
-  char expected_digest[DIGEST_LEN];
 
   if(circ->purpose != CIRCUIT_PURPOSE_C_REND_READY ||
      !circ->build_state->pending_final_cpath) {
@@ -203,6 +201,8 @@ rend_client_receive_rendezvous(circuit_t *circ, const char *request, int request
   circ->build_state->pending_final_cpath = NULL; /* prevent double-free */
 
   for(apconn = circ->p_streams; apconn; apconn = apconn->next_stream) {
+    apconn->cpath_layer = circ->cpath->prev;
+    /* now the last hop is different. be sure to send all the way. */
     if(connection_ap_handshake_send_begin(apconn, circ) < 0)
       return -1;
   }