]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bug 40801: Send LINKED_ACK before attaching streams
authorMike Perry <mikeperry-git@torproject.org>
Thu, 8 Jun 2023 22:44:26 +0000 (22:44 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Fri, 9 Jun 2023 16:29:10 +0000 (16:29 +0000)
Otherwise, the BEGIN cell arrives at the exit before it has an RTT,
and then it does not know which circuit to prefer in response.

src/core/or/conflux_pool.c

index 7e38e151a859b5d043a871b29df737dad1b4aa09..c8018f45e232ced9c0afcbab3e6042e2b36df747 100644 (file)
@@ -797,11 +797,6 @@ try_finalize_set(unlinked_circuits_t *unlinked)
   unlinked->cfx = NULL;
   unlinked_free(unlinked);
 
-  /* Now that this set is ready to use, try any pending streams again. */
-  if (is_client) {
-    connection_ap_attach_pending(1);
-  }
-
   log_info(LD_CIRC,
            "Successfully linked a conflux %s set which is now usable.",
            is_client ? "client" : "relay");
@@ -1964,6 +1959,12 @@ conflux_process_linked(circuit_t *circ, crypt_path_t *layer_hint,
     goto end;
   }
 
+  /* If this set is ready to use with a valid conflux set, try any pending
+   * streams again. */
+  if (circ->conflux) {
+    connection_ap_attach_pending(1);
+  }
+
   goto end;
 
  close: