Commit Graph

36 Commits

Author SHA1 Message Date
Jason Rhinelander
74215fc44c Fix link layer delivery race condition (fix random ping delays)
We trigger a pump immediately, but this is racey because we add to our
plaintext data in a worker thread; if the worker thread runs after the
pump then it ends up leaving plaintext to be handled, but there's no
wakeup until the next one.

This was the cause of seeing a random +1s and bunching added to ping
responses sometimes: it wasn't until the *next* ping goes through the
network that the plaintext queue gets processed, at which point it
flushes the old one and often the new one together.

The fix here gets rid of the map of sessions needing wakeups and instead
adds an atomic flag to all of them to let us figure out which ones
need to be flushed.
2021-11-15 13:36:28 -04:00
Jason Rhinelander
9113a6b36b Triggered pumping
This redoes how/when we pump so that we should only be calling the
idempotent PumpLL() when we actually have (or may have) something to
pump.
2021-11-15 13:35:57 -04:00
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.
2021-03-09 19:01:41 -05:00
Jeff Becker
bb9bd25059
get rid of use of llarp::IpAddress from hotpaths 2021-02-22 10:01:05 -05:00
Jeff
a0ed303d7b
try to handle router deregistrations on the network better (#1461)
* don't send messages to de-registered relays but allow traffic to clients

* actively close sessions to de-registered relays
2020-11-10 09:24:58 -05:00
Stephen Shelton
d897099e1d
Track traffic peerstats 2020-07-02 10:13:24 -06:00
Stephen Shelton
91a2af0eda
Sanity checks around shared_from_this() 2020-06-01 14:56:58 -06:00
Jeff Becker
3eb006f78c
iwp/libuv cleanup: remove llarp_pkt_list and all users of it as it's broke 2020-05-23 16:07:19 -04:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
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.
2020-04-07 12:38:56 -06:00
Jeff Becker
9efd796145
initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05: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
3c1d5518d8 fix windows port and make it compile 2019-10-02 09:06:14 -04:00
Jeff Becker
d04762ab49
unstaged changed 2019-09-12 10:34:27 -04:00
Jeff Becker
78d191bd75
prepare for 0.5.0 2019-08-29 07:45:58 -04:00
Jeff Becker
822f529be8
add link layer delivery feedback 2019-07-26 12:19:31 -04:00
Jeff Becker
61d42811be
prevent crash 2019-05-07 09:04:43 -04:00
Michael
4143472a17
Add cmake module to target a library as 'system', and fix a few warnings 2019-04-25 00:27:31 +01:00
Michael
c39c931d03
Remove IStateful virtual inheritance 2019-04-19 16:10:26 +01:00
Michael
25f10d5b11
Fix more address sanitiser issues 2019-04-02 10:03:53 +01:00
Michael
a7d15467b3
Refactor iwp linklayer 2019-03-29 16:00:12 +00:00
Jeff Becker
4bfe97781c
relax ping to 10s of inactivity 2019-03-18 08:25:32 -04:00
Jeff Becker
1d958d95de
* make rpc compile right
* make link sessions introspectable
* make utp write buffers fully flush each tick
2019-02-15 17:19:19 -05:00
Michael
2de621b0ad
Disable copy constructing llarp_buffer_t 2019-02-01 01:58:13 +00:00
Michael
79157414f3
Split crypto.hpp into 3 different files 2019-01-13 16:32:51 +00:00
Michael
04e0fe3ad7
Move crypto code to a subdirectory 2019-01-13 15:06:16 +00:00
Michael
a3463120cc
Move net components into a distinct folder 2019-01-11 01:42:02 +00:00
Michael
e5eda0fb8f
Move lokinet unspecific components to a util/ library 2019-01-10 20:07:24 +00:00
Jeff Becker
e88c39b9e2
more work 2019-01-05 08:45:05 -05:00
Michael
ea19093a20
Remove const byte* conversion operators from llarp::AlignedBuffer 2019-01-02 01:04:04 +00:00
Jeff Becker
cca19290de
session renegotiation, RC expiration, more utp unit tests, network isolation. 2018-12-19 11:17:41 -05:00
Jeff Becker
e58f2c521e
done for the day 2018-12-17 17:43:16 -05:00
Jeff Becker
b39c46fc03
!!! this breaks backwards compat :^) !!!
redo link protocol to use 2 session keys, add unit tests.
2018-12-17 15:46:08 -05:00
Michael
85dde7b6b0
Move remaining include/llarp headers to llarp/ 2018-12-12 02:53:02 +00:00
Michael
b92ea0521b
Move router_contact.hpp to llarp/ 2018-12-12 02:53:01 +00:00
Michael
c0a76714fa
Move link* to llarp/ 2018-12-12 02:53:01 +00:00