[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] 20/77: we were sorting our pqueue the wrong way



This is an automated email from the git hooks/post-receive script.

dgoulet pushed a commit to branch main
in repository tor.

commit 5e768d5cb98ef8bae1b76c30610dfe21f17a3fda
Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
AuthorDate: Thu Jun 30 21:46:21 2022 -0400

    we were sorting our pqueue the wrong way
    
    i.e. we were putting higher effort intro2 cells at the *end*
---
 src/feature/hs/hs_circuit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index 719e19eded..0c71443879 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -616,12 +616,12 @@ cleanup_on_free_client_circ(circuit_t *circ)
 }
 
 /** Return less than 0 if a precedes b, 0 if a equals b and greater than 0 if
- * b precedes a. */
+ * b precedes a. Note that *higher* effort is *earlier* in the pqueue. */
 static int
 compare_rend_request_by_effort_(const void *_a, const void *_b)
 {
   const pending_rend_t *a = _a, *b = _b;
-  if (a->rdv_data.pow_effort < b->rdv_data.pow_effort) {
+  if (a->rdv_data.pow_effort > b->rdv_data.pow_effort) {
     return -1;
   } else if (a->rdv_data.pow_effort == b->rdv_data.pow_effort) {
     return 0;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits