| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
These methods provide modified error handling,
changed take_until to use take_until_with_limit and added tests.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
| |
This variant is deprecated but it still ought to have a message so
long as it exists.
|
| |
|
|
| |
No semver implications since this wasn't in the last release.
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075485
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075483
|
| | |
|
| |
|
|
|
|
|
|
|
| |
deprecated
Incomplete is a better name.
This lets us use Truncated for the old, deprecated, conflation of
"Incomplete" with what is now "MissingData".
|
| |
|
|
|
|
|
|
|
|
|
| |
This is item 1 from
https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074562
and the alternative to item 2 presented in the 2nd half of
https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074648
(Item 3 was done earlier, but now we change the behaviour.)
Fixes #1614.
|
| |
|
|
|
| |
Tidy up an error message. Now this can be on one line with variable
name interpolation.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce the new constructor and call it at the error generation
sites. But there is still not yet any functional change.
Change the type of Truncated's field to be Sensitive.
The original reason for not doing this no longer applies, since we
don't generally want to open-code construction of this variant.
Conveniently, changing the type means we get to find all the sites
where one *is* constructed and adjust them.
In reader.rs and tor-proto we can just call incomplete_error.
In tor-cell, there's a call site where we previously provided an
underestimate, and where the Reader isn't available. We adjust that
ad-hoc but this is fine because the error variant will
change. (relaycell is using a Reader from from_slice.)
|
| |
|
|
|
|
|
| |
I just perpetrated a bug by adding a variant to this which ended up
not PartialEq to itself. This open-coded match is a footgun.
No functional change.
|
| | |
|
| |
|
|
|
| |
Suggested in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2390#note_3072975
|
| |
|
|
| |
This will allow us to fix #1592, but it doesn't do so yet.
|
| |
|
|
|
|
|
|
| |
This is going to want to do something more complicated (as described
in the docs).
In this commit we change all the tests that are expecting Truncated
errors. That reduces noise in the next commit.
|
| |
|
|
|
|
| |
This commit deprecates the `EncodeError::always_bug` function with a
`From<EncodeError> for Bug` trait, which is a more semantically correct
way to perform this action.
|
| |
|
|
|
|
|
|
|
|
| |
Actually, to avoid making a breaking change, I'm deprecating
BadMessage and creating a new InvalidMessage variant that takes a
Cow. This way I don't need to track every crate that re-exposes
tor_bytes::Error and call this a breaking change in those.
Making this change will allow tor_bytes errors to be much more
helpful.
|
| | |
|
| |
|
|
| |
This will help down the line as we make more writers fallible.
|
| |
|
|
|
|
|
|
|
|
|
| |
Since there is currently only one error type that can occur when
encoding, it doesn't make sense to use the full Error type here.
This split will help us downstream, as we no longer need to
categorize tor_bytes::Error as "an error in encoding or decoding".
I considered renaming Error to DecodeError, but that had pretty huge
downstream effects, and didn't seem to be worth it.
|
| |
|
|
|
| |
Also note an issue with the design of tor-bytes::Error that should
probably go in a separate MR.
|
| |
|
|
| |
Writing is going to be able to give errors too.
|
| |
|
|
| |
Including supporting machinery, new kind field, etc.
|
| |
|
|
|
|
| |
This crate's Error type is too low-level to have an ErrorKind, but
it does make sense to use InternalError for the internal errors
here.
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|