summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'chan_arc' into 'main'Nick Mathewson2024-05-286-32/+34
|\ | | | | | | | | Proto: Refactor Channel to always be Arc. See merge request tpo/core/arti!2163
| * Make Channel non-Clone.Nick Mathewson2024-05-161-2/+2
| |
| * proto: Make Channel explicitly Arc<.>Nick Mathewson2024-05-166-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Channel was a type that you could Clone that implicitly its state. Now, Channel always appears as an Arc<Channel>. This change has several benefits: * It makes the relationship between Channel struct and the underlying channel more clear. * It enables Channel to participate in the RPC system, where everything has to be an Arc<.> * It enables us to have a Weak<Channel>, if we ever want to. * It will let us move various members out of ChannelDetails. We did this change a while ago with ClientCirc.
* | chanmgr: Delegate to Channel::engage_padding_activities explicitly.Nick Mathewson2024-05-171-1/+1
|/ | | | | | (This isn't a bugfix, but it helps avoid the appearance of a function calling itself. This _would_ become a bug if we imported the wrong trait into scope here.)
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-138-0/+8
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-4/+2
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* ChannelState::ready_to_expire: return true when rem time is zeroJim Newsome2023-12-131-0/+5
| | | | | | | | | | | This fixes a race condition that would normally be fairly benign - it would result in scheduling to check for expired channels again immediately, and assuming non-zero time passes would then remove the channel. In Shadow's default time model though, zero time passes in this case, so we just keep scheduling to check again immediately forever; i.e. deadlock.
* ChannelState::ready_to_expire: refactor using let-elseJim Newsome2023-12-131-18/+14
|
* continually_expire_channels: don't round off expiration delayJim Newsome2023-12-131-1/+1
| | | | | | | | | Without this change, if the delay is less than one second, the code will effectively busy-loop until the delay has elapsed. This potentially leads to deadlock in shadow simulations, and wastes CPU in real usage. https://shadow.github.io/docs/guide/limitations.html?highlight=busy#busy-loops
* continually_expire_channels: refactor using let-elseJim Newsome2023-12-131-3/+2
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-chanmgrIan Jackson2023-10-111-1/+1
|
* Add initial support for running a PT in server modeSaksham Mittal2023-08-242-3/+3
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-238-0/+8
|
* Resolve a pair of warnings about redundant closures.Nick Mathewson2023-08-221-1/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Fix a pair of rustdoc links in chanmgr.Nick Mathewson2023-07-191-2/+2
|
* Move an import to resolve a warning.Nick Mathewson2023-07-131-1/+2
|
* Explain better why you would use build_unmanaged_channelNick Mathewson2023-07-131-2/+7
|
* Resolve numerous typos in `ChanMgr::build_unmanaged_channel` codegabi-2502023-07-131-4/+4
|
* chanmgr: Remove now-unused (and never usable) builder() method.Nick Mathewson2023-07-131-12/+0
|
* chanmgr: Document makeup and timeout behavior of our factoriesNick Mathewson2023-07-131-0/+22
| | | | | Basically, it's all ChanBuilder at some point, and ChanBuilder has a timeout.
* chanmgr: Add an experimental build_unmanaged_channel() method.Nick Mathewson2023-07-131-0/+26
| | | | | This method will let the user construct a channel that isn't stored or monitored by the ChanMgr.
* Gate builder() behind experimental-api featureSaksham Mittal2023-07-121-1/+1
|
* Merge branch 'channelfactory' into 'main'Nick Mathewson2023-07-121-1/+7
|\ | | | | | | | | Expose channel builder in order to create channels more efficiently in external code See merge request tpo/core/arti!1374
| * Make CompoundFactory private for external codeSaksham Mittal2023-07-071-1/+0
| |
| * Mark builder() as experimentalSaksham Mittal2023-07-061-0/+1
| |
| * Import ChannelFactory instead of CompoundFactorySaksham Mittal2023-07-061-3/+3
| |
| * Rename get_channelbuilder() to builder()Saksham Mittal2023-07-061-1/+1
| |
| * Conditionally make CompoundFactory publicSaksham Mittal2023-07-061-1/+2
| |
| * Remove now unnecessary lines for importSaksham Mittal2023-07-051-2/+0
| |
| * Import CompoundFactory regardless of feature levelSaksham Mittal2023-07-051-3/+1
| |
| * Create new method to expose CompoundFactorySaksham Mittal2023-07-051-0/+9
| |
| * Expose CompoundFactory for later exposure in APISaksham Mittal2023-07-051-1/+1
| |
* | Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-119-0/+9
|\ \ | | | | | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * | Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-109-0/+9
| | |
* | | rng ranges: Use gen_range_checked().expect() in obvious cases (fmt)Ian Jackson2023-07-101-2/+3
| | |
* | | rng ranges: Use gen_range_checked().expect() in obvious casesIan Jackson2023-07-101-2/+3
|/ / | | | | | | In each of these, it is locally obvious that the range is nonempty.
* | Add exceptions for some cases of diverging_sub_expressionNick Mathewson2023-07-101-0/+2
| | | | | | | | | | | | | | | | See here for documentation on the lint: https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression The issue here, from what I can tell, is that the lint triggers whenever you use a diverging expression as a function body within an
* | Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-072-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.
* ChanMgr: Tweak documentation a bit.Nick Mathewson2023-06-281-9/+13
| | | | | Adjust formatting, add more references to lower-level APIs, and clarify lifetimes a little more.
* Add Channel expiry info in ChanMgr docsSaksham Mittal2023-06-271-0/+7
|
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Fix a local-only CPU DoS bug.Nick Mathewson2023-05-231-0/+15
| | | | | | | | | | | | | | | | | | Previously, there was a bug in the way that our code used our SOCKS implementations. If the buffer used for a SOCKS handshake became full without completing the handshake, then rather than expanding the buffer or closing the connection, our code would keep trying to read into the zero-byte slice available in the full buffer forever, in a tight loop. We're classifying this as a LOW-severity issue, since it is only exploitable by pluggable transports (which are trusted) and by local applications with access to the SOCKS port. Closes #861. Fixes TROVE-2023-001. Reported-By: Jakob Lell <jakob AT srlabs DOT de>
* chanmgr: fix a unit-default warning from clippy nightly.Nick Mathewson2023-05-181-1/+1
| | | | | | I could also have stopped using `::default()` to construct this (testing-only) object, but I think it makes more sense to turn it into a non-unit object.
* chanmgr: remove a needless mut.Nick Mathewson2023-05-111-1/+1
| | | | This fixes a warning from nightly clippy.
* tor-netdir: Update tests to parse the descriptor, make test consensus ↵Gabriela Moldovan2023-05-031-1/+2
| | | | | | lifetime configurable. Signed-off-by: Gabriela Moldovan <[email protected]>