Age | Commit message (Collapse) | Author |
|
|
|
|
|
This reverts commit 200ee1cace2f17537e6982ac447ea65d7c7a00b3.
|
|
This reverts commit 5ff099763b1f56414572e1c12eb2f003117db5a0.
|
|
|
|
|
|
- rework ip_ntoa() to avoid use of static variables
- rework sort_client_list() to avoid use of static variables
- move static 'lastdump' into Messenger struct
- rework ID2String() to avoid use of static variables; rename to id_to_string()
- fetch_broadcast_info(): attempt to mitigate risks from concurrent execution
- current_time_monotonic(): attempt to mitigate risks from concurrent execution
- comment on non-thread-safety of unix_time_update
|
|
"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".
|
|
|
|
|
|
|
|
|
|
Previously, all log messages generated by tox_new (which is quite a lot)
were dropped, because client code had no chance to register a logging
callback, yet. This change allows setting the log callback from the
beginning and removes the ability to unset it.
Since the log callback is forever special, since it can't be stateless,
we don't necessarily need to treat it uniformly (with `event`).
|
|
This is to allow new group chats to coexist with old group chats. We do
not rename everything in group.[ch] to conference, yet, because it's not
currently necessary, and a general internal API overhaul is due at some
point anyway.
|
|
We don't currently support callbacks without context object.
|
|
|
|
This reverts commit 21f8db12c45bd56293262cd4abfb73cd9abec821.
It is currently broken. Incoming call callbacks are not invoked, and
instead the client goes offline immediately.
|
|
|
|
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
|
|
This header is a requirement for the public API, therefore is assumed to
exist. It is a C99 standard library header, and _Bool is not intended to
be used directly, except in legacy code that defines bool (and
true/false) itself. We don't use or depend on such code. None of our
client code uses or depends on such code. There is no reason to not use
bool.
|
|
|
|
Messenger is slightly twisty when it comes to sending connection status
callbacks It will very likely need at the very least a partial refactor to
clean it up a bit. Toxcore shouldn't need void *userdata as deep as is
currently does.
(amend 1) Because of the nature of toxcore connection callbacks, I decided to
change this commit from statelessness for connections changes to statelessness
for friend requests. It's simpler this was and doesn't include doing anything
foolish in the time between commits.
group fixup because grayhatter doesn't want to do it
"arguably correct" is not how you write security sensitive code
Clear a compiler warning about types within a function.
|
|
|
|
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
|
|
|
|
|
|
|
|
Moved a few #defines to the top of the header for better readability
|
|
See #40 for details.
|
|
See #27 and #40 for details.
|
|
**What are we doing?**
We are moving towards stateless callbacks. This means that when registering a
callback, you no longer pass a user data pointer. Instead, you pass a user data
pointer to tox_iterate. This pointer is threaded through the code, passed to
each callback. The callback can modify the data pointed at. An extra indirection
will be needed if the pointer itself can change.
**Why?**
Currently, callbacks are registered with a user data pointer. This means the
library has N pointers for N different callbacks. These pointers need to be
managed by the client code. Managing the lifetime of the pointee can be
difficult. In C++, it takes special effort to ensure that the lifetime of user
data extends at least beyond the lifetime of the Tox instance. For other
languages, the situation is much worse. Java and other garbage collected
languages may move objects in memory, so the pointers are not stable. Tox4j goes
through a lot of effort to make the Java/Scala user experience a pleasant one by
keeping a global array of Tox+userdata on the C++ side, and communicating via
protobufs. A Haskell FFI would have to do similarly complex tricks.
Stateless callbacks ensure that a user data pointer only needs to live during a
single function call. This means that the user code (or language runtime) can
move the data around at will, as long as it sets the new location in the
callback.
**How?**
We are doing this change one callback at a time. After each callback, we ensure
that everything still works as expected. This means the toxcore change will
require 15 Pull Requests.
|
|
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
|
|
|
|
Removed useless include.
|
|
|
|
A TCP callback could be received when only a UDP connection was present.
Increased a UDP timeout to make it less likely to time out and switch to TCP.
|
|
|
|
with them.
|
|
also removed remnants of the no longer used variable ping_lastrecv
|
|
|
|
other size (except streaming of course).
|
|
any file number for them in core.
These can be used to tell friends we don't have an avatar set or to unset
a set avatar.
|
|
messaging function.
This removes code duplication and allows us to easily add new message
types to the api without having to add new functions.
|
|
This function can be used to seek an incoming file tranfer right
before accepting it.
It is meant to be used to resume incomplete file tranfers by clients.
|
|
file_id is a 32byte identifier that can be used by users to identify
file tranfers across core/client restarts in order to resume broken
file tranfers.
In avatar tranfers it corresponds to the hash of the avatar.
Added tox_file_get_file_id() function to api to obtain the file_id
of an ongoing file transfer.
If not set, core will generate a random one.
|
|
first 32 bytes.
Enforce length of filename in core when transfer is an avatar type
transfer to make things more safe.
|
|
This allows clients to agree on what numbers mean what without having
it be set in core.
|
|
in the requested chunk callback.
For zero size transfers if the data sent is not the same length, the
file is assumed to be done.
|
|
callback.
|
|
This is done so that the function now has the same parameters as the
request chunk callback.
|