Commit Graph

143 Commits

Author SHA1 Message Date
Jeff Becker
bf0416cab8
remove Time_t, add operator overload for printing llarp_time_t and add to_json function for serializing llarp_time_t to json 2020-02-25 12:05:13 -05:00
Jeff Becker
ecdab10dac
explictly use std::chrono::milliseconds 2020-02-25 11:05:54 -05:00
Jeff Becker
df427ffa0e
use llarp_time_t instead of auto 2020-02-25 11:02:14 -05:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
Jason Rhinelander
b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
2020-02-21 23:22:47 -04:00
Jeff
5901d0eb6b
Merge pull request #1092 from majestrate/reduce-iwp-multiack-frequency-2020-02-10
Reduce iwp multiack transmission frequency
2020-02-11 07:09:28 -05:00
Jeff Becker
8b77ec31ef
reduce number of multiack packets sent 2020-02-10 15:01:51 -05:00
Stephen Shelton
3d00feb08a
Make format 2020-02-10 12:51:54 -07:00
Stephen Shelton
7f0972d48e
Use name 'StateToString()' instead of ambiguous 'toString()' 2020-02-10 09:27:12 -07:00
Stephen Shelton
63ad7c8b91
Leave IWP session JSON stats 'tx' and 'rx' for compat 2020-02-10 09:17:40 -07:00
Stephen Shelton
2279ebeb40
Add IWP session stats to JSON API 2020-02-07 11:43:40 -07:00
Jeff Becker
9efd796145
initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
Jeff Becker
0f6c5958ba
add bw stats to iwp sessions 2019-12-17 09:36:56 -05:00
Jeff Becker
fc55469cfe
change interval such that FEC is less often done 2019-12-14 15:55:36 -05:00
Jeff Becker
a93e0a735b
fix typo, reduce delivery timeout 2019-12-14 13:50:36 -05:00
Jeff Becker
fcd3750a8b
increase ack window 2019-12-14 06:55:38 -05:00
Stephen Shelton
68a604070b
Merge pull request #945 from notlesh/key_manager_cleanup
Key manager cleanup (post 0.6-rc1)
2019-12-06 12:54:40 -07:00
Stephen Shelton
66a058a2af Make format 2019-12-06 10:13:09 -07:00
Jeff Becker
9be4092a2a
more close changes 2019-12-05 11:31:58 -05:00
Jeff
27b1e36039
Merge pull request #936 from majestrate/dev
last changes before 0.6.0 version bump
2019-12-03 15:58:22 -05:00
Stephen Shelton
49e248bfc1 Fix bad merge 2019-12-03 12:24:57 -07:00
Stephen Shelton
93b8832026
Merge branch 'dev' into private-keys-backup-support 2019-12-03 11:20:45 -07:00
Stephen Shelton
521ef9b5bb Handle link transport key in KeyManager 2019-12-03 10:58:53 -07:00
Jeff Becker
86a4ccd98f
unconditionally bundle first fragment in xmit 2019-12-03 12:54:32 -05:00
Jeff Becker
1f83fdb190
fix previous commit 2019-12-03 12:54:23 -05:00
Jeff Becker
19835ce501
dont use auto 2019-12-03 12:53:20 -05:00
Jeff Becker
1a6a66108d
make it compile 2019-12-03 12:53:11 -05:00
Jeff Becker
c88602ee16
break the world to make it faster 2019-12-03 12:53:01 -05:00
Jeff Becker
1a06da9c3d reduce calls in link pump 2019-11-29 19:11:14 -04:00
Jeff Becker
ac686a9329
remove valgrind access errors 2019-11-22 16:23:20 -05:00
Jeff Becker
b207db626f
please the gods of valgrind 2019-11-22 16:23:20 -05:00
Jeff Becker
56dce90de9
add trace log level for tracking logic thread jobs 2019-11-22 16:23:19 -05:00
Jason Rhinelander
d96d33329b
Merge pull request #912 from majestrate/logic-thread-fix-2019-11-13
fix logic thread behavior
2019-11-19 15:26:35 -04:00
Stephen Shelton
b5b8cf0745 Reduce log level of IWP session issues as they may be encountered frequently and normally 2019-11-19 12:17:34 -07:00
Stephen Shelton
ef2670dfb4 Drop new inbound IWP sessions when the first packet can't be handled 2019-11-19 09:24:29 -07:00
Jeff Becker
b34caa3e26
make unit tests pass for iwp 2019-11-14 11:48:02 -05:00
Jeff Becker
c9f26c4911
call Router::PumpLL after every batch of packets from a link session 2019-11-04 13:49:08 -05:00
Jeff Becker
1fc36f4832
changes from review 2019-11-04 12:24:42 -05:00
Jeff Becker
8befd6f2db
flush link session encrypt queue immediately after handling plaintext packets 2019-11-04 08:34:30 -05:00
Jeff Becker
e2890e925b
make it compile 2019-10-28 17:46:39 -04:00
Jeff Becker
20dd4e4d09
use data not begin 2019-10-28 17:39:24 -04:00
Jeff Becker
2267a7d283
fix bounds check 2019-10-28 17:23:43 -04:00
jeff
4af6dca246 use static_cast 2019-10-02 11:35:33 -04:00
jeff
3c1d5518d8 fix windows port and make it compile 2019-10-02 09:06:14 -04:00
jeff
32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-01 10:51:28 -04:00
Michael
86a07e2a80
Enable more sanitisers 2019-09-23 11:47:58 +01:00
Jeff Becker
327c545530
finish multithread cryptography first pass 2019-09-16 12:12:05 -04:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
jeff
ac2a2aed1d gut libutp and finish making things compile and pass tests 2019-09-12 14:19:25 -04:00
Jeff Becker
d04762ab49
unstaged changed 2019-09-12 10:34:27 -04:00