summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-circmgr: Turn a type annotation comment into codeIan Jackson2022-02-041-2/+1
| | | | | | | | | | | | | | | | The type annotation may not be necessary for inference, but as a comment it risks becoming false. So it should be uncommented, or deleted. Error types round here are not entirely trivial so uncomment it.
* | Properly linkify two doc comment xrefs to issuesIan Jackson2022-02-041-2/+2
|/ | | | | | | | | | | | | | | | | | | | | Fixes these messages: warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:115:5 | 115 | /// https://github.com/notify-rs/notify/issues/165 and | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/issues/165>` | = note: `#[warn(rustdoc::bare_urls)]` on by default = note: bare URLs are not automatically turned into clickable links warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:116:5 | 116 | /// https://github.com/notify-rs/notify/pull/166 . | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/pull/166>` | = note: bare URLs are not automatically turned into clickable links
* Merge branch 'ticket270' into 'main'Nick Mathewson2022-02-036-17/+303
|\ | | | | | | | | | | | | Watch configuration files and reload them when they change Closes #270 See merge request tpo/core/arti!280
| * Document that `notify` behavior is strange with symlinksNick Mathewson2022-02-033-0/+15
| | | | | | | | | | | | | | | | | | | | (More specifically, `notify` behaves differently on different platforms. On some, it can watch specific directory objects on the filesystem, and so it only notices when _those_ directories change. If you change a symlink so that the canonical configuration file location is now in some other directory, `notify` won't notice. But on other platforms, notify just does "stat()" in a loop. On those, it _will_ notice if the configuration file changes.)
| * Avoid a potential infinite loop in configuration-watchingNick Mathewson2022-02-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | Since the user can put their logfiles and configuration files in the same directory, writing to the log can trigger an event from `notify`. If we log every non-interesting event from `notify`, then we'll trigger the logs every time we log, and fill up the disk. This commit removes the offending log and adds a comment about why. If we someday decide we do need to log here, maybe we can rate-limit the messages or something.
| * Treat rescan events as meaning "reload configuration".Nick Mathewson2022-02-031-2/+2
| |
| * Add a couple of TODOs about configuration-watching.Nick Mathewson2022-02-021-0/+7
| |
| * Before reloading configuration, drain all pending file changesNick Mathewson2022-02-021-0/+8
| | | | | | | | | | This way, if there are a bunch of changes at once, we only reload one time.
| * Refactor file-watching code to watch parent directories.Nick Mathewson2022-02-021-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | Due to limitations in notify and the OS APIs it uses, it isn't actually so useful to watch a single file. Instead, we have to watch the directories that contain the files, and filter out any events that aren't about the specific files we care about. I've put the logic here into a new type, but I've left the type un-exported: its API is pretty ugly, inasmuch as the caller needs to jump through hoops to only get the events that they want. That's not too bad so long as the API is private, but we'd want better if we were exposing this.
| * arti: Limit mut-ness of cfg_sources to one block.Nick Mathewson2022-02-021-12/+16
| |
| * arti-config: add blank lines between functions.Nick Mathewson2022-02-021-0/+6
| |
| * arti-config: Small type and comment refactoring from review.Nick Mathewson2022-02-021-2/+0
| |
| * Detect changes in non-client configuration sections tooNick Mathewson2022-02-012-17/+30
| | | | | | | | We don't yet do much with these, but we can avoid discarding them.
| * Make configuration-watching configurable and off-by-default.Nick Mathewson2022-02-014-4/+68
| | | | | | | | | | | | | | | | I'm slightly concerned about whether this is behavior people would expect to have on-by-default, so let's make this off-by-default for now. Maybe the `application` and `system` sections should merge?
| * Reload configuration when our configuration files change.Nick Mathewson2022-02-014-2/+73
| | | | | | | | Closes #270
* | Merge branch 'eta/reactor-2.5' into 'main'eta2022-02-031-33/+60
|\ \ | | | | | | | | | | | | Fix severe reactor ordering problems See merge request tpo/core/arti!282
| * | Fix severe reactor ordering problemseta2022-02-031-33/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of severe problems with the circuit reactor were fixed which could cause reordering of cells (which causes relays to terminate the circuit with a protocol violation, as they become unable to decrypt them). These mostly revolve around improper usage of queues: - The code assumed that a failure to place cells onto the channel would persist for the duration of a reactor cycle run. However, under high contention, this wouldn't always be the case. - This leads to some cells getting enqueued while others go straight through, before the enqueued cells. - To fix this, we block sending cells out of the channel while there are still some enqueued. - The hop-specific queues queued after encryption, not before. This was very brittle, and led to frequent mis-ordering. - This was fixed by making them not do that. This is arti!264 / 5bce9db5628126be2b736f228211174fe4132918 without the refactor part.
* | | Merge branch 'add-final-newline-force' into 'main'Nick Mathewson2022-02-031-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Add editorconfig to force some rules (Final Newline) See merge request tpo/core/arti!289
| * | | Add editorconfig to force some rules (Final Newline)Daniel Schischkin2022-02-031-1/+1
| | | |
* | | | Merge branch 'dirclient-testing' into 'main'Nick Mathewson2022-02-0313-45/+174
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | dir-client: bug fix and more tests See merge request tpo/core/arti!271
| * | | | Explain a testing oddity in tor-dirclient.Nick Mathewson2022-02-031-1/+11
| | | | |
| * | | | Fix a stale comment in tor-dirclient.Nick Mathewson2022-02-031-2/+1
| | | | |
| * | | | Upgrade required version of futures crate to 0.3.14Nick Mathewson2022-02-0112-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Earlier versions have a bug in UnboundedReceiver that make our new dirclient tests fail.
| * | | | dirclient: refactor and test "should-i-retire-the-circuit" code.Nick Mathewson2022-02-011-6/+13
| | | | |
| * | | | dirclient: Add tests for a number of failing cases.Nick Mathewson2022-02-011-25/+136
| | | | | | | | | | | | | | | | | | | | | | | | | These bring the case a tiny improvement in test coverage, and also manage to turn up a few bugs.
| * | | | dirclient: don't return too-long responses on decompression failureNick Mathewson2022-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a couple of places where we forgot to truncate our return-buffer to its actual size, and instead returned a big bunch of zeros. Found while writing the tests in the next commit. Someday, we'll have ReadBuf and won't have to worry about these things.
* | | | | Merge branch 'typos' into 'main'eta2022-02-037-7/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix typos See merge request tpo/core/arti!285
| * | | | | Fix typosDimitris Apostolou2022-02-027-7/+7
| | |/ / / | |/| | |
* | | | | Temporarily disable some clippy lints on nightlyIan Jackson2022-02-0210-1/+11
| | | | |
* | | | | Untangle two needless Ok(r?) into just rIan Jackson2022-02-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by clippy::needless_question_mark. Sometimes Ok(r?) is needed to do automatic error conversion. I assume the lint checks for that. Anyway, in these cases it's not needed.
* | | | | Remove many needless borrows and slicesIan Jackson2022-02-025-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via clippy::needless_borrow. In some cases I removed needless `[..]` too. See also: needless_borrow suggestion doesn't go far enough https://github.com/rust-lang/rust-clippy/issues/8389
* | | | | clippy: Pass simply &output to fs::writeIan Jackson2022-02-021-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | clippy::needless_borrow quibbles here, IMO correctly. Its suggestion didn't go far enough: output is a String and a &String can be passed to write as-is for identical effect.
* | | | Merge branch 'reload-config-prep' into 'main'Ian Jackson2022-02-025-61/+108
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| Preparatory work for auto config reload See merge request tpo/core/arti!284
| * | Un-Arc<> TorClient in the arti crateNick Mathewson2022-02-012-8/+5
| | | | | | | | | | | | | | | TorClient doesn't need to be wrapped in an Arc any longer, thanks to other refactoring.
| * | arti_config: Refactor configuration sources into a structNick Mathewson2022-02-013-52/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is by no means our final API, but should represent an improvement. Here instead of having to specify a list of files and their is-this-optional status, along with a list of command-line options, we have a single structure that encapsulates all of that information. Two advantages here: - Callers no longer have to remember what the boolean means. - We can "reload" more easily, by keeping the source object around. This change also implements the correct behavior for our default configuration file in `arti::main`: if the file is absent and the user doesn't list a config file, that's no problem. But if the user lists _that very same config file, we should insist that it be present.
| * | Expose Reconfigure enum from arti-client.Nick Mathewson2022-02-011-1/+1
| | | | | | | | | | | | | | | This enum is required to use `TorClient::reconfigure` correctly, and as such ought to be re-exported.
* | | arti-bench: summarize statistics with a new `Statistic` type (#298)eta2022-02-011-49/+86
|/ / | | | | | | | | | | | | | | This implements the proposal from arti#298, making the `BenchmarkResults` type be made out of a bunch of new `Statistic` types (which summarize the mean, median, range, and standard deviation of an arbitrary value) instead of overloading `TimingSummary` for this purpose.
* / Fix invalid path character on windowsMichael2022-01-312-2/+6
|/
* Bump tor-netdir and tor-guardmgr versionsarti-v0.0.4Nick Mathewson2022-01-314-9/+9
| | | | | | | | tor-netdir needs to bump because tor-netdoc bumped, even though there were no other changes in tor-netdir. Whoops. tor-guardmgr needs to bump because it already published, with the older tor-netdir.
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-3115-67/+67
|
* Use script to update README.md files.Nick Mathewson2022-01-283-15/+16
|
* Merge branch 'bug299' into 'main'Ian Jackson2022-01-285-13/+85
|\ | | | | | | | | | | | | Make max_file_limit configurable Closes #299 See merge request tpo/core/arti!261
| * Make max_file_limit configurableNeel Chauhan2022-01-285-13/+85
| |
* | Fix test failure in tor_dirmgr::state::test::get_microdescs_stateNick Mathewson2022-01-271-1/+12
| | | | | | | | | | | | | | | | | | This failure occurred because our tests use canned data to exercise the directory state functionality, and the canned consensus has suddenly become very expired. There are better fixes possible, but this is a minimal one that should get CI working on main again.
* | tor-rtcompat: remove some unused code.Nick Mathewson2022-01-271-16/+0
| | | | | | | | | | Nothing actually used these accessor functions, and it's not clear what would. We can add them later if they're needed.
* | tor-rtcompat: Add some miscellaneous testsNick Mathewson2022-01-274-0/+91
| | | | | | | | | | These probably aren't for things that will fail IRL, but it's nice to have coverage on the code, just in case.
* | tor-rtcompat: Simplify test-declaration macros.Nick Mathewson2022-01-271-60/+35
| | | | | | | | Now there's much less copy-and-paste.
* | Move tor-rtcompat tests to lib.rsNick Mathewson2022-01-272-311/+312
|/ | | | | | | | | | | This makes our layout more similar to our other crates, and successfully informs our grcov exclusion pattern that these tests are indeed tests. Doing this knocks down the reported coverage for the tor-rtcompat crate, but that's okay: we hadn't earned it. I hereby promise that this commit is only code-movement.
* Document why {current,create}_runtime are type-erasedNick Mathewson2022-01-271-9/+19
|
* Apply @eta's suggestions from review on !263eta2022-01-272-2/+2
| | | Comment-only.