diff options
| author | Arlo Breault <arlolra@gmail.com> | 2015-03-27 13:14:09 -0700 |
|---|---|---|
| committer | Arlo Breault <arlolra@gmail.com> | 2015-03-27 13:14:09 -0700 |
| commit | f506e69362cf9bd38f5a823cbdf7c0da585b12e7 (patch) | |
| tree | 2c064b1918513c746ae94bff6a0e37c216179288 | |
| parent | ad424311980e22d49b4e99aa00fa1c5c584adfe2 (diff) | |
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
| -rw-r--r-- | datastore.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 + } }) } |
