aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-socksproto/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-socksproto: Handle 0-byte reads (EOF) correctlyIan Jackson2024-10-011-0/+5
| | | | | | | This restores the functionality of socks users: detect closed sockets. 0c595818f713916d94b7b0e4062f953fad7c9799 which we reverted as part of rebasing this branch onto main.
* tor-socksproto: Introduce into_output_forbid_pipeliningIan Jackson2024-10-011-0/+12
|
* tor-socksproto: Introduce new APIIan Jackson2024-10-011-0/+8
|
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-111-1/+1
| | | | | | | | | deprecated Incomplete is a better name. This lets us use Truncated for the old, deprecated, conflation of "Incomplete" with what is now "MissingData".
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-101-1/+1
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* s/ProtocolFailed/ProtocolViolation/g where possibleNeel Chauhan2023-04-081-1/+1
|
* socksproto: impl Clone for Error.Nick Mathewson2022-10-201-1/+1
|
* Implement client-side SOCKS handshakeNick Mathewson2022-09-281-0/+5
|
* tor-socksproto: Style and info fixes in errors.Nick Mathewson2022-06-221-4/+6
| | | | | (The use of Cow<> in the error message isn't strictly necessary here, but it's a pattern I want to encourage.)
* tor-socksproto: Use bad_api_usage! rather than ad-hoc Invalid errorIan Jackson2022-02-151-7/+0
|
* Make Bug from InternalError, add bad_api_usage! and into_bad_api_usage!Ian Jackson2022-02-151-6/+6
| | | | Including supporting machinery, new kind field, etc.
* New name and semantics for BadAPIUsage (was BadArgument)Ian Jackson2022-02-151-1/+3
|
* Merge branch 'error-socksproto-autoconvert' into 'main'Nick Mathewson2022-02-141-1/+1
|\ | | | | | | | | Provide, and use From impl for InternalError See merge request tpo/core/arti!315
| * Provide, and use From impl for InternalErrorIan Jackson2022-02-141-1/+1
| | | | | | | | | | | | | | | | Adding this autoconversion is quite safe since every error generation site is explicit and has its own context, and we don't really need to add more. This simplifies the code and will simplify future work.
* | Merge remote-tracking branch 'origin/mr/313'Nick Mathewson2022-02-141-2/+2
|\ \
| * | tor_socksproto::Error HasKind fix two delegationsIan Jackson2022-02-141-2/+2
| |/ | | | | | | | | | | | | | | | | | | We should not generally explicitly specify a kind for errors which contain a more detailed error which itself has a kind. Stating the kind literally is a latent bug, which becomes a real bug if the contained type's kind changes or starts to vary. (There may be exceptions to this principle but this isn't one of them.)
* | Merge branch 'error-kind-protocol' into 'main'Ian Jackson2022-02-141-1/+1
|\ \ | | | | | | | | | | | | Split up ErrorKind::ProtocolViolation See merge request tpo/core/arti!312
| * | Split up ErrorKind::ProtocolViolationIan Jackson2022-02-141-1/+1
| |/
* / Split up ErrorKind::NoSupportIan Jackson2022-02-141-3/+3
|/
* socksproto: Simplify Truncated handlingNick Mathewson2022-02-111-19/+13
| | | | | | | | | | | | | Refactor the Error type to remove the yucky internal hidden Truncated variant. Instead, there's now an embedded tor_bytes::Error value. If that tor_bytes::Error is Truncated, we bubble it up when we convert our handshake result to the nested error struct. Thus there is still (sadly) a variant of tor_socksproto::Error that shouldn't be exposed to user code. But refactoring every inner method under handshake.rs seemed like a bad idea: once we're using Result<Result<..>>, the ? operator no longer helps us much.
* Move the Truncated error into tor-errors.Nick Mathewson2022-02-111-15/+0
|
* Try to resolve the "Truncated" error in tor-socksprotoNick Mathewson2022-02-111-22/+22
| | | | | I'm not in love with this solution; the others just seem a bit ugly too.
* tor-socksproto: Implement HasKindNick Mathewson2022-02-111-2/+41
| | | | | (This error isn't yet wrapped in TorError, but it will be eventually when we implement socks proxy and PT support.)
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+49
This will cause some pain for now, but now is really the best time to do this kind of thing.