summaryrefslogtreecommitdiff
path: root/crates/tor-cell/src/chancell
Commit message (Collapse)AuthorAgeFilesLines
* tor-cell: Stop using write_infallibleNick Mathewson2022-07-111-14/+31
| | | | Also, stop using "expect" and "assert!" to check for errors.
* tor-cell: Make encoding method signatures fallible.Nick Mathewson2022-07-112-24/+40
|
* tor-cell: convert BytesErr to a struct variantNick Mathewson2022-06-222-3/+8
|
* tor-cell: error usefulness and style fixesNick Mathewson2022-06-222-5/+11
|
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* tor-proto: add a backend to detect reported clock skew.Nick Mathewson2022-03-231-2/+14
| | | | | | | | | | | | | | | | NETINFO cells, which are sent in every handshake, may contain timestamps. This patch adds an accessor for the timestamp in the Netinfo messages, and teaches the tor-proto code how to compute the minimum clock skew in the code. The computation isn't terribly precise, but it doesn't need to be: Tor should work fine if your clock is accurate to within a few hours. This patch also notes a Y2038 problem in the protocol: see torspec#80. Part of #405.
* Merge branch 'educe-traits' into 'main'Ian Jackson2022-03-041-6/+5
|\ | | | | | | | | Replace many manual trait impls with use of educe See merge request tpo/core/arti!375
| * Move skip_fmt into tor-basic-utilsIan Jackson2022-03-041-1/+2
| | | | | | | | | | | | | | Code motion and the minimal mechanical changes. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
| * Replace manual Debug impl with educe in tor-cellIan Jackson2022-03-021-7/+5
| |
* | Replace manual Default impl with std derive in tor-cellIan Jackson2022-03-021-6/+1
|/
* Merge branch 'clippy-followup' into 'main'Nick Mathewson2022-02-171-3/+3
|\ | | | | | | | | Remove some needless refs and slicing See merge request tpo/core/arti!327
| * Remove some needless refs and slicingIan Jackson2022-02-171-3/+3
| | | | | | | | | | Prompted by nightly's clippy (which has some false positives, so is currently disabled).
* | tor-cell: provide HasKind.Nick Mathewson2022-02-151-2/+3
|/ | | | | | | | | Additionally, refactor the IoError out of tor_cell::Error: nothing in TorCell created this; it was only used by tor_proto. This required refactoring in tor_proto to use a new error type. Here I decided to use a new CodecError for now, though we may refactor that away soon too.
* tor-cell: replace an XXXX with a TODO.Nick Mathewson2021-12-161-1/+6
| | | | | The original comment was a gnomic question about what to box; the real issue is that we want to avoid copying data in our critical path.
* Extend trace messages for destroy/truncated reasons.Nick Mathewson2021-12-151-0/+40
| | | | | | | | | | | | It makes sense to put the method for human-readable strings onto the type itself, so that we can format these whenever they occur. I'm choosing the "human_str" method name here, since caret-generated types already have a to_str. I was thinking about using Display, but caret types already implement that. I've also moved the message from "warn!" to "debug!", since these aren't necessarily a problem condition.
* s/hidden/onion/g in code commentsNeel Chauhan2021-12-131-1/+1
|
* Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-3/+3
| | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* add semicolons if nothing returnedDaniel Eades2021-11-251-5/+5
|
* deglob some enums, use concise iteration syntaxDaniel Eades2021-11-251-4/+4
|
* enable checked_conversions lint.Nick Mathewson2021-10-091-6/+19
|
* Document every macro.Nick Mathewson2021-09-071-1/+2
| | | | | (The nightly version of clippy now includes macros for its missing_docs_in_private_items lint.)
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-272-0/+1243
This will cause some pain for now, but now is really the best time to do this kind of thing.