This repository has been archived by the owner on Jan 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a timer to expire circuits promptly.
The timer is scheduled to run ten minutes after the last circuit that was created. This way, the last ten minutes of circuits are not guaranteed to stick around in memory indefinitely. Caveat: This doesn't _zero_ the memory, so it may still appear in `strings /proc/N/mem`. But it does make the memory available to be recycled, so it's not _guaranteed_ to still appear in `strings /proc/N/mem`. Also, timestamp the map entries. If we explicitly create a new map entry for a site by requesting a new identity, the old expiry queue entry will not delete it, but a new expiry queue entry will delete it. This way, circuits created by requesting a new identity are not shorter-lived than other circuits. We leave the old entries in the priority queue because there's no convenient way to delete them with std::priority_queue. In principle, this might leak space if you repeatedly request a new identity, but it can only leak as much space as you use by repeatedly requesting a new identity for a maximum of ten minutes. fix #611 real good this time Auditors: @darkdh Test Plan: 1. Search DDG for `what is my ip address'. 2. Record the IP address it reports. 3. Reload. 4. Confirm it's the same IP address. 5. Full-reload. 6. Confirm it's a different IP address. Record the new IP address. 7. Wait >10min. 8. Reload. 9. Confirm it's a different IP address again.
- Loading branch information
1 parent
fbf2a29
commit c59eec1
Showing
2 changed files
with
87 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters