Adrien Béraud
6c705e525f
net: factorize logic to network_utils
2019-04-08 12:07:11 -04:00
Adrien Béraud
4401e47002
cleanup, fix clang-tidy warnings
2019-03-17 17:43:52 -04:00
Adrien Béraud
1e10e28fd7
network: improve message parsing performance
2019-03-17 16:07:20 -04:00
Adrien Béraud
f418b3651f
update copyright date
2019-03-16 12:37:23 -04:00
Adrien Béraud
313f54c840
dht: disable some verbose logs
2019-03-10 17:27:37 -04:00
Adrien Béraud
39e69f813c
network engine: cleanup
2019-02-19 01:59:59 -05:00
Adrien Béraud
c0e376e15a
dht: reduce log verbosity
2018-12-28 01:41:10 -05:00
Yanfei Han
dc4a790a38
A obviouse bug on network engine
2018-11-29 00:47:00 +08:00
Adrien Béraud
092f5cfef0
network_engine: fix warning
2018-11-26 16:34:19 -05:00
Adrien Béraud
00c1be9cdc
logger: use DBG for DEBUG to avoid name conflicts
2018-11-22 15:43:55 -05:00
Adrien Béraud
b2171d707a
network engine: properly apply flag MSG_NOSIGNAL
2018-05-25 10:26:58 -04:00
Adrien Béraud
60db9fd9cd
logs: reduce node expiration to debug level
2018-05-25 10:26:58 -04:00
Adrien Béraud
e8989f1f79
network engine: handle EPERM
2018-05-24 16:07:16 -04:00
Adrien Béraud
9249f34c47
network engine: fix node leak during destruction
2018-05-24 15:01:23 -04:00
Adrien Béraud
4a49a53222
Revert "network engine: expire node on next run on network failure"
...
This reverts commit 8489433060 .
2018-05-02 11:55:01 -04:00
Adrien Béraud
8489433060
network engine: expire node on next run on network failure
2018-04-11 11:27:46 -04:00
Adrien Béraud
6a2f61a0db
dht: fix compilation warnings
2018-04-10 12:48:19 -04:00
Adrien Béraud
d2df93c75e
network engine: send nodes in listen confirmation
2018-03-28 09:54:04 -04:00
Adrien Béraud
1617c79e5d
network: add signaling for expired, refreshed values
2018-03-14 23:39:35 -04:00
Adrien Béraud
cab0813b17
dht: reduce log verbosity
2018-02-24 15:15:49 -05:00
Adrien Béraud
e6a2d96622
net: restart socket in case of sigpipe
2018-01-23 11:34:14 -05:00
Adrien Béraud
3a61692618
net: set MSG_NOSIGNAL if possible
2017-11-17 02:20:31 +01:00
Adrien Beraud
dc99919338
InfoHash: add explicit operator bool()
2017-11-01 11:59:11 -04:00
Adrien Béraud
fcaaa01b2d
network engine: add "value update" message type
2017-10-30 13:12:16 -04:00
Adrien Béraud
8cd3ff9fc4
network engine: remove unused constant
2017-10-30 13:12:16 -04:00
Adrien Béraud
476fbb1160
network: use full 32-bits of transaction IDs
...
We used to use the first 16 bits for the message type.
2017-10-20 17:42:28 +02:00
Adrien Béraud
cf6447dc80
NetworkEngine: use proper type for constant
2017-10-17 19:22:15 +02:00
Adrien Béraud
376486e64f
node: use full range of socket IDs
2017-10-17 15:25:09 +02:00
Adrien Béraud
9d4e6e0984
rate limiter: use deterministic maintenance
...
Using deterministic maintenance sets an upper bound
to the size of the address map.
2017-10-15 01:18:32 +02:00
Adrien Béraud
e9f007025f
node: make most fields private
2017-10-13 01:10:09 +02:00
Adrien Béraud
e20ae56cab
dht: support client mode
...
In client mode, a node won't store data
and won't participate in routing.
2017-10-12 15:44:14 +02:00
Adrien Béraud
4ce0168916
network engine: move ParsedMessage to separate file
2017-10-11 23:51:44 +02:00
Adrien Béraud
98ec789526
nertwork engine: move tid management to Node
2017-10-11 17:36:20 +02:00
Adrien Béraud
3bb5e7ee12
network engine: move transaction ownership to Node
2017-10-11 17:36:20 +02:00
Adrien Béraud
be7494961c
network engine: move socket management to Node
2017-10-11 02:23:56 +02:00
Adrien Béraud
bdb0bef0ee
network engine: move RequestAnswer out of class
2017-10-11 02:22:03 +02:00
Adrien Béraud
1c45f34262
SockAddr: use pointer to sockaddr
...
Save memory and reduce copies by using a pointer
to a sockaddr structure of the right size instead of
using a full sockaddr_storage structure for every address.
2017-09-26 16:30:29 +02:00
Adrien Beraud
9bfaa224bc
dht: move set_nonblocking to NetworkEngine
2017-07-16 18:10:49 -04:00
Adrien Beraud
15e5fa433b
network engine: handle EAFNOSUPPORT
2017-07-15 23:46:33 -04:00
Adrien Beraud
43ff0e9e52
network engine: handle EAGAIN, ENETUNREACH
...
Handle a few common error codes from send():
* EAGAIN: reschedule without increasing retry count.
This prevent nodes from failing on slow/very slow connections.
* ENETUNREACH, EHOSTUNREACH: expire the node immediately instead
of waiting for an answer, to expire IPv6 nodes quickly if no
IPv6 network is available.
2017-07-15 23:36:33 -04:00
Adrien Beraud
73bcebf355
license cleanup
2017-04-10 01:43:20 +02:00
Adrien Beraud
696ac1bbd5
network engine: print error if send fails
...
for now just print an error
2017-04-05 17:52:34 +02:00
Adrien Beraud
ab7d175322
network engine: make buffer length depend on HASH_LEN
2017-03-07 23:14:25 +01:00
Adrien Béraud
c4d5621f67
network: treat loopback address as sender address
...
When learning about nodes in an answer,
we used to drop nodes with loopback address.
Address is now replaced by the packet sender
address and the port is preserved.
2017-02-10 00:10:11 -05:00
Adrien Béraud
34908d573f
network engine: use make_shared
2017-02-08 14:14:06 -05:00
Adrien Béraud
ac65ca5177
add shortcut Sp for std::shared_ptr
2017-01-24 23:38:31 -05:00
Simon Désaulniers
b03a8b5b50
update license notice (2017)
2017-01-13 17:27:29 -05:00
Adrien Béraud
b6dca5ccd6
dht: use new NodeStats structure to provide stats
2017-01-10 23:34:56 -05:00
Adrien Béraud
7f84c1e397
utils: remove useless definitions
2016-11-23 15:12:37 -05:00
Simon Désaulniers
2d9f6241a9
net: don't close socket on listen renew
2016-11-08 16:07:15 -05:00