[tor-commits] [check/master] Dedup text/plain bulk exit list
arlo at torproject.org
arlo at torproject.org
Fri Mar 27 21:10:49 UTC 2015
commit f506e69362cf9bd38f5a823cbdf7c0da585b12e7
Author: Arlo Breault <arlolra at gmail.com>
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
+ }
})
}
More information about the tor-commits
mailing list