| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |\
| |
| |
| |
| | |
tor-cell: Rename for_client and for_relay
See merge request tpo/core/arti!793
|
| | |
| |
| |
| |
| |
| |
| | |
This commit renames the for_client and for_relay functions to
from_client and from_relay respectively, in order to indicate their
origin, as the term "for" is more likely to indicate a destination,
which is not true in that situation.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-cell: Fix typos in msg.rs
See merge request tpo/core/arti!788
|
| | |/ |
|
| |\ \
| | |
| | |
| | |
| | | |
tor-cell: Remove redundant match clauses
See merge request tpo/core/arti!792
|
| | |/
| |
| |
| |
| | |
This commit removes two redundant match clauses inside the
take_one_netinfo_addr function found inside msg.rs.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-cell: Make historical comments more concrete
See merge request tpo/core/arti!787
|
| | |/
| |
| |
| |
| | |
This commit extends comments that make references to historical protocol
versions of Tor, by adding the concrete protocol version numbers.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-cell: Avoid redundant pointer copy
See merge request tpo/core/arti!791
|
| | |/
| |
| |
| |
| |
| | |
This commit changes an iteration by copying a u16 (which is 2 bytes)
instead of a pointer address, which is most likely 8 bytes on most
machines.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-cell: Avoid redundant allocation
See merge request tpo/core/arti!790
|
| | |/
| |
| |
| |
| |
| | |
This commit changes the way how a vector with a known sized gets
allocated, by using Vec::with_capacity() instead of Vec::new().
It will eventually avoid an allocation of more memory than required.
|
| |/
|
|
|
|
| |
This commit renames the fixed_len! macro to fixed_len_handshake!, in
order to indicate, that this macro is only suited for cells with
commands related to handshaking.
|
| | |
|
| | |
|
| |
|
|
|
| |
These have the unit in the type. Putting that in the field name too
is otiose.
|
| |
|
|
|
| |
This allows test cases to describe precisely the contents of the
negotiation cell ought to be generated.
|
| |
|
|
|
| |
As proposed in
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/77
|
| |
|
|
|
| |
This gets rid of some random hardcoded literals. We're going to want
to reuse this, too.
|
| |
|
|
|
|
|
|
| |
We don't really want the caller to pass ignored timeout parameters.
And this makes more semantic sense.
The stop constructor uses zero, which is what C Tor does. See
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/76
|
| |
|
|
|
|
|
|
| |
This will be convenient for managing when to send these negotiation
messages.
While we're here, edit the comment to explain how this is (going to
be) used.
|
| |
|
|
| |
Also, stop using "expect" and "assert!" to check for errors.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
Replace many manual trait impls with use of educe
See merge request tpo/core/arti!375
|
| | |
| |
| |
| |
| |
| |
| | |
Code motion and the minimal mechanical changes.
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
|
| | | |
|
| |/ |
|
| |\
| |
| |
| |
| | |
Remove some needless refs and slicing
See merge request tpo/core/arti!327
|
| | |
| |
| |
| |
| | |
Prompted by nightly's clippy (which has some false positives, so is
currently disabled).
|
| |/
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
(The nightly version of clippy now includes macros for its
missing_docs_in_private_items lint.)
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|