Age | Commit message (Collapse) | Author |
|
|
|
This fixes a buffer overflow when a malformed *.tox save file is
loaded.
|
|
|
|
A group loaded from a savefile starts with AV disabled.
|
|
(Implementing suggestions of sudden6)
|
|
|
|
* send freeze packet on quit
* delete existing peers with same real_pk on adding a peer
* record actual number of conference peers saved
|
|
|
|
* add global friend_connection status callback, used for group rejoining
* stop leaving groups on killing tox
|
|
to any peers
|
|
|
|
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.
|
|
* 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
|
|
|
|
|
|
|
|
Somehow it still works because the lower levels can deal with
inconsistent/broken state, but this lets us avoid that broken state in
the first place. If a friend connection doesn't exist, we don't add it to
our group.
|
|
The void pointer here only adds opportunity to introduce bugs and doesn't
actually make things more layered. It's just the code lying about being
layered while it's actually spaghetti.
|
|
|
|
|
|
Presumably the uses of `rand()` were fine because they were not used in
security-sensitive places, but having to think about whether a crappy RNG
is acceptable in each situation requires effort that could better be
spent elsewhere.
Also, this means that once we have a custom deterministic RNG for
testing, that RNG is used everywhere, so all the code is deterministic.
It also allowed us to delete a system-specific function that wasn't used
anywhere except in a call to `srand()`.
|
|
* test names in conference_test
* raise error on attempt to invite friend to group before we are connected
* revise handling of temporary invited connections
We are now careful not to prematurely delete a connection to a peer
established during the invitation process; namely, before we have sufficient
other connections and have confirmed that we have an alternative route to the
peer.
* process out-of-order messages from a peer
* don't reset names when handling a Peer Response
|
|
This almost entirely avoids any else-after-return in toxcore. One case is
left, and that one is more readable this way.
Why no else after return: https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
Why exemptions exist: https://blog.mozilla.org/nnethercote/2009/08/31/no-else-after-return-considered-harmful/
|
|
Also moved some macros up to the beginning of `group.c`. This change
brings us closer to the PGC PR.
|
|
These are useful once we have persistent group chats, so clients can
store data associated with this permanent group identifier.
|
|
By changing numchats from uint32_t to uint16_t. This is done in PGC. This
PR is making that change in master to reduce the diff in the PGC branch.
Also:
* Inverted groupnumber_not_valid and renamed to is_groupnumber_valid.
* Renamed realloc_groupchats to realloc_conferences and made it return bool.
* Added setup_conference function that currently just zeroes the
conference structure but later will initialise more values.
* Made some `i` iterator variables local to the for-loop using
for-init-decl. This is also done in PGC.
|
|
Also some other cleanups. This PR means that future PRs, i.e. the PGC PR,
must not break the rules established here.
|
|
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.
2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
could go backward in time but I think I might have started using it like
if it could not after I changed it so that it would never go back in time
```
|
|
We used to pass the actual peer numbers of peers leaving, but we no
longer know these in the PGC world, so we don't pass them anymore.
|
|
|
|
|
|
Fixes #768
|
|
We can now revert the changes to the callbacks and keep supporting them
until clients have moved off them.
|
|
fixes #606
|
|
|
|
The logic and behaviour remain the same, but PEER_EXIT and PEER_JOIN are
merged into LIST_CHANGED. This allows clients to take a first step to
adapt to the API change without us having to actually submit the full
change, yet.
|
|
This reverts commit e16d3894c5979fcfe1c57bf7dadc455ce690baf9 and
commit c5976e37eaadf663dc3d0c18376ea023355048f3.
|
|
This changes only code, no string literals or comments.
|
|
Turning this code:
```c
if (cond) { ... return 0; }
if (!cond) { ... return 0; }
return -1;
```
into:
```c
if (cond) { ... return 0; }
else { ... return 0; }
```
The `return -1` in the first variant can never happen.
|
|
|
|
|
|
|
|
|
|
Also replace &(x) with &x for consistency.
|
|
|
|
This requires that every symbol, even if static (file-scope), is unique.
The idea is that we can easily run "whole" program static analysis on
programs that include monolith.h ("whole" is in quotes, as we don't
include dependencies like libsodium in this static analysis).
|
|
socket -> net_socket
htons -> net_htons
htonl -> net_htonl
connect -> net_connect
sendto -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
|
|
|
|
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
|
|
|