*h.end() only works on VS 2015 with
_SECURE_SCL=0
_ITERATOR_DEBUG_LEVEL=0
Also, if these flags are used when compiling opendht, it seems that any client program that wants to link against opendht also needs the same flags enabled, which is a terrible requirement to force on a client.
The proposed change makes the code a bit cleaner and doesn't require any preprocessor tricks.
Add support to log using standard syslog,
add related option in dhtnode.
dhtnode will use syslog by default
when starting in daemon mode and
no logfile is defined.
Throw an exception if GnuTLS is too old
instead of not providing the API.
Also consistently throw in case of hash error,
and return 0 for an empty hash, for both
PublicKey and Certificate.
Prefer a const reference instead of shared_ptr if the shared_ptr
is not used and argument type is not changed in the method.
This allows to prevent useless shared_ptr allocations.
In getRealPrefix, use OpState to track state instead of using many
different shared_ptr.
allow to use system argon2 library, use system library by default:
* add --with(out)-argon2 configure options
* add -DOPENDHT_ARGON2=(On/Off) cmake option
also bump argon2 to latest git
Fixes a bug where some callbacks wouldn't be called when a dummy request was
inserted to cancel some operation while not using the
net::Request::State::COMPLETED flag as per 19c47ec.
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.
"Iterators pointing to an element between the new logical end and the physical
end of the range are still dereferenceable, but the elements themselves have
unspecified values (as per MoveAssignable post-condition)."
- http://en.cppreference.com/w/cpp/algorithm/remove
* A value should be considered announced if all good nodes up to a count of
TARGET_NODES have been tried in the search .
* Bug fix where SearchNode::isAnnounced criteria was not consistent with
announce operation.
The op token is renewed regularly (around every 30 minutes),
so SHA256 provides enough security for this non-sensitive token.
SHA256 takes 32 bytes instead of 64 bytes for SHA512,
and the token is included in every listen requests,
renewed every 30 seconds, and every answer to get.
In the context of limited bandwith usage, using SHA256 seems more appropriate.
This change is backward and forward compatible.