Age | Commit message (Collapse) | Author |
|
Also added and used the new crypto_malloc and crypto_free.
The latter also zeroes out the memory safely. The former only exists for
symmetry (static analysis can detect asymmetric usages).
|
|
* add global friend_connection status callback, used for group rejoining
* stop leaving groups on killing tox
|
|
to any peers
|
|
(I found I couldn't remember whether get_mono_time returned unix time or
not, and had to source-dive to find out. This should make that
unnecessary next time!)
|
|
|
|
|
|
These are not compiled out under `NDEBUG` and should be provably correct.
|
|
|
|
|
|
Including in tests and implementation files.
|
|
So it gets regenerated when the .api.h file changes.
|
|
|
|
|
|
|
|
No use making this a macro. LTO will inline this anyway, if we care about
performance. Generally, we avoid function-like macros that can be functions.
|
|
See https://github.com/TokTok/toktok-stack/pull/38.
|
|
This resets friend search rate in two circumstances where it should be
reset:
* When the friend gets a dhtpk packet to us;
* When a friend connection to the friend goes down.
|
|
This CI can run Bazel tests, because it supports IPv6. This is nice,
because now we can run IPv6 tests on every PR.
|
|
We were mistakenly not making a rejoin attempt on freezing connections
due to all closest connections going down. This fixes that, and tweaks
the test. I've still only done tens rather than hundreds of tests, but
I'm fairly confident that the conference test now consistently passes.
|
|
|
|
|
|
Using the full path including the repo name.
|
|
|
|
Possibly this is what's happening in #1149.
|
|
|
|
This is for modules like groups to hook into to have their own state
management in the `tox_savedata` format.
|
|
|
|
|
|
* add freezing and unfreezing of peers
* add rejoin packet
* revise handling of temporary invited connections
* rename "peer kill" packet to "peer leave" packet
* test rejoining in conference test
* use custom clock in conference test
|
|
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
|
|
The raw clock isn't subject to NTP adjustments. It may run less
accurately than the regular monotonic clock. I see no reason why raw
would be better for tox than the normal one.
This avoids one piece of OS-specific ifdef'd code.
|
|
Can't trivially get rid of recursion here, since it's a non-linear
recursive function.
|
|
|
|
Also adds a test (auto_reconnect_test) which fails without this change.
|
|
This inverts the truthiness of the return value. Previously, 0 meant
`true` and -1 meant `false`. Now, `true` (1) means `true` and `false` (0)
means `false`.
|
|
|
|
|
|
Changes:
* 100 columns maximum (not strict, can be a bit more sometimes).
* No space after cast.
|
|
|
|
Was: Util, should be: MonoTime.
|
|
No timeout test here yet, because we don't yet have the ability to
manipulate time at will, so we would have to actually sleep.
|
|
* Assignments can't be used as expressions, therefore `while` loops
should not be used as a `for-each` construct. Use `for`, instead.
|
|
|
|
So we don't accidentally elide the call given that it's a pure function
and its result isn't used.
|
|
|
|
|
|
|
|
Reduced by, e.g.:
* `file_transfer_test`: 33% of the `clock_gettime` calls.
* `tox_many_test`: 53% of the `clock_gettime` calls.
Other tests will see similar improvements. Real world applications will
be closer to 40-50% improvement, since tox_many_test has 100 nodes, while
file_transfer_test has 2 nodes.
|
|
|
|
|