Age | Commit message (Collapse) | Author |
|
This is to prepare for ToxAV becoming independent of toxcore internal calls.
|
|
We put some tokstyle exemptions into the source files themselves,
instead. This way we can check some of the code in those files, and more
in the future when tokstyle supports more constructs (like apidsl).
Also: hacked ping_array.api.h to not emit `_array` as parameter names.
We'll need to fix apidsl to do this better. This works for now.
|
|
|
|
This adds complexity for very little value.
|
|
See https://github.com/TokTok/hs-tokstyle/pull/49 for the corresponding
tokstyle analysis.
|
|
This one is unfortunately a little more complicated to use. I may add a
simpler API later, but for now, it's JSON-based (because I couldn't get
binary data to work without it getting mangled somewhere along the way -
JSON is at least text-transport-safe).
|
|
|
|
Remove useless parameter, replace with assert (just to be sure). Also
replaced some memsets with 0-initialiser and memcpy with assignment.
|
|
This function exists and simplifies some code a little bit. There are
lots of places in DHT.c where we have the exact same code, so there is a
lot of opportunity to factor out common bits. For now, we just make a
minor improvement that's easy to review.
|
|
|
|
This may fix problems with very large conferences. Sadly, it seems
infeasible to test large conferences on one machine, so this is entirely
theoretical.
|
|
This allows invitations to work in the case that the invitee is already
in the group, which can happen if the group becomes split. Such an
invitation is automatically accepted, leading to the peers becoming
connected in the group and sharing peer lists.
|
|
Avoid any dynamic format strings, even ones like `cond ? "str1" : "str2"`.
|
|
* make static functions return bool rather than int to indicate success
* add peer_in_list() to factor out uniformity over peer and frozen lists
* reduce repetition in send_lossy_all_close
* rename 'close' to 'connections'
* use uint32_t for peernumber (in accord with tox.c)
* explain persistence in tox_conference_get_chatlist documentation
* clarify "connectedness" in group API documentation
* clarify that tox_conference_peer_count counts only online peers
* refactor variously
|
|
In windows network code, we implement inet_pton and inet_ntop, which take
void pointers. We can do slightly better because we already know the type
when we call these functions, so we can avoid casting between void
pointer and the addr struct types.
|
|
Most of our enums already have one. Some didn't. Tokstyle is going to
require commas at the end of enumerator lists in enum definitions.
|
|
Tokstyle (check-cimple) will start enforcing comment formats at some
point. It will not support arbitrary stuff in comments, and will parse
them. The result can then be semantically analysed.
|
|
|
|
Using ~0 involves a bitwise operation on int, so depends on
the internal representation of signed integers.
|
|
|
|
|
|
We don't expose this to the user code, yet, because it would break the
API, but this is useful for future internal code.
|
|
The current code violates the C standard and causes crashes on strict
alignment architectures.
|
|
The latter is doing pretty much the same thing but in a confusing way (it
doesn't change the type of the variable, but does change the semantics).
|
|
|
|
|
|
Put a future message number into the save file.
Peers require the message numbers of messages we send to increase
monotonically. If we save the current message number, then send further
messages, then quit without saving (e.g. due to a crash), and then
resume from the old save data, then monotonicity will fail. This commit
works around this problem by introducing an offset when the current
message number, so that even in the above circumstance, as long as fewer
messages than the offset were sent between saving and reloading, the
sent message numbers will increase monotonically.
The choice of offset is a balance between wanting it to be large enough
that there is room for plenty of messages to be sent in the above
scenario, and wanting to avoid the following potential problem: if we
repeatedly save and reload without sending any further messages, then
the message number may increase so far that peers will interpret an
eventual message as being old. This is not conceivably a practical issue
for the 32bit lossless message numbers, but is a concern for the 16bit
lossy message numbers.
|
|
|
|
When tox_kill is called no other thread should be running anymore so
this locking is not needed there.
|
|
- Moving a pthread_mutex in memory (e.g. via realloc()) is undefined
behavior.
- add a state for allocated but not yet used crypto connections
- change crypto_connection_status signature
|
|
* unset global status callback in kill_groupchats
* avoid dangling friend connections
* fix num_introducer_connections leak
* stop trying to keep connection alive on freeze
* avoid relaying lossless messages back to sender where possible
* avoid sending gratuitous online packets
|
|
|
|
This could make mono_time loose overflows on Windows.
|
|
Since mono_time is accessed from the main thread as well as the toxav
thread it is needed to properly lock time updates.
|
|
|
|
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)
|
|
Also, use them in the `onion_client` module.
|
|
This code is undefined behaviour as is, and breaks on various platforms
requiring strict alignment (many microcontrollers).
|
|
|
|
* send freeze packet on quit
* delete existing peers with same real_pk on adding a peer
* record actual number of conference peers saved
|
|
|
|
Closes #1264
|
|
|