Commit Graph

26 Commits (b81f7025c9a619409bb1c3f39e0c56e2084fd7be)

Author SHA1 Message Date
Jason Rhinelander b81f7025c9
Replace logging with oxen-logger
Replaces custom logging system with spdlog-based oxen logging.  This
commit mainly replaces the backend logging with the spdlog-based system,
but doesn't (yet) convert all the existing LogWarn, etc. to use the new
format-based logging.

New logging statements will look like:

    llarp::log::warning(cat, "blah: {}", val);

where `cat` should be set up in each .cpp or cluster of .cpp files, as
described in the oxen-logging README.

As part of spdlog we get fmt, which gives us nice format strings, where
are applied generously in this commit.

Making types printable now requires two steps:
- add a ToString() method
- add this specialization:

      template <>
      constexpr inline bool llarp::IsToStringFormattable<llarp::Whatever> = true;

This will then allow the type to be printed as a "{}" value in a
fmt::format string.  This is applied to all our printable types here,
and all of the `operator<<` are removed.

This commit also:
- replaces various uses of `operator<<` to ToString()
- replaces various uses of std::stringstream with either fmt::format or
  plain std::string
- Rename some to_string and toString() methods to ToString() for
  consistency (and to work with fmt)
- Replace `stringify(...)` and `make_exception` usage with fmt::format
  (and remove stringify/make_exception from util/str.hpp).
2 years ago
Jeff Becker 108b8e089e
HandleTimeout can touch iterators so do all handling of lookup timeouts outside of loop iteration 3 years ago
Jeff Becker a94c100e7b
improve log messages about expiring convotags 3 years ago
Jeff Becker 8dd1358cc6
* tweak introset handover timeouts
* introset path haodver tweaks
* improve warn/error messages to convey more information
* dont block on queue insertion
* reset convotag on decrypt/verify fail
* add multiple ready hooks on outbound context
* lookup introsets from close routers on dht
* continue to tick dead sessions so they expire their paths
* introset spacing
* reduce lns lookup diversity requirement for speed
* add a function to send reset convotag message
* only have 1 outbound context at a time
3 years ago
Jeff Becker 4889b8cddf
fix up client to snode codepath 3 years ago
Jeff Becker 7098f46d60
rpc endpoint for triggering quic tunnel 3 years ago
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
3 years ago
Jeff 21930cf667
LNS (#1342)
* initial relay side lns

* fix typo

* add reserved names and refactor test for dns

* lns name decryption

* all wired up (allegedly)

* refact to use service::EncryptedName for LNS responses to include nonce with ciphertext

* fully rwemove tag_lookup_job

* replace lns cache with DecayingHashTable

* check for lns name validity against the following rules:

* not localhost.loki, loki.loki, or snode.loki

* if it contains no dash then max 32 characters long, not including the .loki tld (and also assuming a leading subdomain has been stripped)

* These are from general DNS requirements, and also enforced in
registrations:

* Must be all [A-Za-z0-9-]. (A-Z will be lower-cased by the RPC call).

* cannot start or end with a -

* max 63 characters long if it does contain a dash

* cannot contain -- in the third and fourth characters unless it starts with xn--

* handle timeout in name lookup job by calling the right handler with std::nullopt
4 years ago
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
4 years ago
Jeff Becker 79746e3719
remote lookup limiting of 500ms per address 4 years ago
Jeff Becker ce335dc47d
remove convotags on dead outbound context 4 years ago
jeff 32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 5 years ago
jeff f9fb40f590 final touches 5 years ago
jeff 7c691cf334 handover should be fixed now 5 years ago
jeff 6c2ebbb925 try fixing handover and add snapp traffic to multithreaded crypto workers 5 years ago
Michael 1aec0dfa2b
Move logging to subdirectory 5 years ago
Michael e52492911d
Refactor endpoint state management to a new class 5 years ago
Jeff Becker d6ec528a72
start work on seperating ips out of endpoint 5 years ago
Jeff Becker a323003824
differentiate between inbound and outbound convos 5 years ago
Michael 1744ae7686
Tidy up service endpoint a bit more 5 years ago
Jeff Becker b02a3715df
call hook on timeout 5 years ago
Jeff Becker fc3db98e66
change log priority 5 years ago
Jeff 59e6a4bc3d make snode work again probably 5 years ago
Jeff Becker cde4fcc00a
queue pending traffic 5 years ago
Jeff Becker 0b68d3db5d
move stuff arround so that flushing queues are done in the correct event loops
TODO: locking
5 years ago
Michael 725ee293c1
Refactor well named functionality in service::Endpoint into new struct 5 years ago