]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Prop 209: Add in hidserv path bias counts for usage.
authorMike Perry <mikeperry-git@fscked.org>
Sun, 18 Nov 2012 01:51:27 +0000 (17:51 -0800)
committerMike Perry <mikeperry-git@fscked.org>
Fri, 7 Dec 2012 23:28:38 +0000 (15:28 -0800)
src/or/connection_edge.c
src/or/or.h
src/or/rendclient.c
src/or/rendservice.c

index cb2afe1e86a63db24b1e9083e2850be0d796fcd7..a654b617119fe6edebe9938c900b3d399d4a7601 100644 (file)
@@ -2454,6 +2454,10 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
     assert_circuit_ok(circ);
 
     connection_exit_connect(n_stream);
+
+    /* For path bias: This circuit was used successfully */
+    origin_circ->any_streams_succeeded = 1;
+
     tor_free(address);
     return 0;
   }
index f26fc394faa49f4930eb8d78619f2f5f37efdfb4..8501235b7b470fe7f220c52fbae65c15fac00a1e 100644 (file)
@@ -2873,9 +2873,8 @@ typedef struct origin_circuit_t {
   unsigned int isolation_any_streams_attached : 1;
 
   /**
-   * Did any SOCKS streams actually succeed on this circuit?
-   *
-   * XXX: We probably also need to set this for intro other hidserv circs..
+   * Did any SOCKS streams or hidserv introductions actually succeed on
+   * this circuit?
    */
   unsigned int any_streams_succeeded : 1;
 
index 3fb4025e6942788f6b0f0ad96abb7e29096b2a02..ec43041b1a57b0b68d328e6eec30a1763e9436d7 100644 (file)
@@ -378,6 +378,9 @@ rend_client_introduction_acked(origin_circuit_t *circ,
        * it to specify when a circuit entered the
        * _C_REND_READY_INTRO_ACKED state. */
       rendcirc->base_.timestamp_dirty = time(NULL);
+      
+      /* For path bias: This circuit was used successfully */
+      circ->any_streams_succeeded = 1;
     } else {
       log_info(LD_REND,"...Found no rend circ. Dropping on the floor.");
     }
index 09792bd1d7eea024164a6d4f2cef36ee9d9797d0..775edd6046df4cc734e065feeb9f9c1fb9a01025 100644 (file)
@@ -1383,6 +1383,9 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
   if (circuit_init_cpath_crypto(cpath,keys+DIGEST_LEN,1)<0)
     goto err;
   memcpy(cpath->handshake_digest, keys, DIGEST_LEN);
+          
+  /* For path bias: This circuit was used successfully */
+  circuit->any_streams_succeeded = 1;
 
   goto done;