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

[tor-commits] [check/master] Dedup text/plain bulk exit list



commit f506e69362cf9bd38f5a823cbdf7c0da585b12e7
Author: Arlo Breault <arlolra@xxxxxxxxx>
Date:   Fri Mar 27 13:14:09 2015 -0700

    Dedup text/plain bulk exit list
    
     * These duplicates are a result of trac 10499 but, in general, the
       authorities do allow up to two relays to exit from the same ip.
    
     * Closes trac 15480
---
 datastore.go |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/datastore.go b/datastore.go
index 34106a6..4ce9516 100644
--- a/datastore.go
+++ b/datastore.go
@@ -130,8 +130,12 @@ type Exits struct {
 
 func (e *Exits) Dump(w io.Writer, tminus int, ip string, port int) {
 	ap := AddressPort{ip, port}
+	var last string
 	e.GetAllExits(ap, tminus, func(exit string, _ string, _ int) {
-		w.Write([]byte(exit + "\n"))
+		if exit != last {
+			w.Write([]byte(exit + "\n"))
+			last = exit
+		}
 	})
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits