Commit Graph

39 Commits

Author SHA1 Message Date
Gregory Mullen (grayhatter)
1f94c96266
Make the friend message callback stateless 2016-08-20 11:07:49 -07:00
Gregory Mullen (grayhatter)
0e18966a27
Make Typing change callback stateless
Moved a few #defines to the top of the header for better readability
2016-08-19 16:13:23 -07:00
iphydf
bdf5ac37b4
Make friend_status_message callback stateless.
See #40 for details.
2016-08-18 17:19:23 +01:00
iphydf
a5e35180c7
Make tox_callback_friend_name stateless.
See #27 and #40 for details.
2016-08-18 00:01:53 +01:00
iphydf
dd8a568141
Make self_connection_status callback stateless.
**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.
2016-08-17 14:57:20 +01:00
Gregory Mullen (grayhatter)
6f3e689eeb
Fix a few issues with running Toxcore tests on Travis-CI
> increased the timeout for TCP tests because per @irungentoo the network on Travis-CI can be slow sometimes

> allowed groupchats test to restart on error until timeout This had to be done because current groupchats are fundamentally broken and 3/5 times they'll 'net-split' on connect

>> Drop group chat tests, add comment to the reason

> added some debugging information to TCP tests, and a #define to force IPV6 (Travis-CI only uses IPv4 on their containers) and decreased the itr interval

> Went crazy with timeouts for Tox network stuff on Travis. Tests on TCP will still randomly fail due to timeouts. I can't reproduce on any local system. So again per @irungentoo, Travis is slow, let's offer it a short bus.
2016-08-11 14:41:57 -07:00
iphydf
532435120a
Remove trailing whitespace from toxav.in.h. 2016-07-07 12:44:16 +02:00
nobody
285dabdbc1 Updated to match current toxav.h 2016-03-09 01:22:15 +13:00
Eniz Vukovic
87828a1b42 Add synchronization protection for send_frame API functions 2015-10-24 01:56:49 +02:00
Eniz Vukovic
363771ea3c Fix typo and change logger config option 2015-10-13 00:35:46 +02:00
Eniz Vukovic
8f130b6f25 Remove old comment 2015-10-11 00:41:34 +02:00
Eniz Vukovic
d6fdf16520 New Adaptive BR algorithm, cleanups and fixes 2015-10-10 23:54:23 +02:00
mannol
c641b0fceb Updated with upstream 2015-08-09 12:39:21 +02:00
mannol
657a57b406 Fixed memory leak during session cleanup and fixed naming. 2015-08-07 02:04:04 +02:00
mannol
7d5de68364 Fixed CALL_STATE naming 2015-07-10 16:54:53 +02:00
mannol
dd0880af38 Fixed documentation. 2015-07-09 03:40:47 +02:00
Jfreegman
f3b65bc3dc
Fix a couple API doc mistakes 2015-07-07 02:05:45 -04:00
mannol
6c126e34e6 Implement handling capability change on rtp level 2015-06-30 01:41:38 +02:00
mannol
2ecb71bb1e Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE 2015-06-27 17:28:07 +02:00
mannol
1ba55d0ca7 Added explanation about how audio callback works 2015-06-27 16:12:33 +02:00
mannol
08bc4eb0e0 Added payload turning off by setting bit rate to 0 2015-06-27 01:55:28 +02:00
mannol
f9f17fdf10 Merge remote-tracking branch 'upstream/master' into new_api 2015-06-25 00:58:23 +02:00
irungentoo
12663475bc
Merge branch 'typo' of https://github.com/zetok/ProjectTox-Core 2015-06-20 21:35:51 -04:00
irungentoo
022a3ec0d8
Merge branch 'doc' of https://github.com/zetok/ProjectTox-Core 2015-06-20 21:35:20 -04:00
Zetok Zalbavar
0536bf8fc4
Fix typo in readme: "enrironment" → "environment" 2015-06-20 18:54:37 +01:00
Zetok Zalbavar
68dc14f80c
Add real instruction on how to use APIDSL and astyle
also add to "tox{,.in}.h" note that "tox.h" shouldn't be edited directly,
pointing to "tox.in.h"
2015-06-20 01:22:46 +01:00
Zetok Zalbavar
4ffd5584f9
Improve documentation about tcp_port
Apparently it's not entirely clear that it's not needed in clients.

v2, as provided by @nurupo
2015-06-20 01:08:43 +01:00
mannol
979d7730aa Forgot about this 2015-06-05 22:18:21 +02:00
mannol
d694839d60 Rebased on master and removed alpha channel (again) 2015-06-05 22:14:37 +02:00
irungentoo
6d883f488f
Return error if file_id parameter is NULL. 2015-06-03 19:56:12 -04:00
irungentoo
5ea703c844
Comment fix. 2015-05-29 19:01:14 -04:00
irungentoo
29c37bf2f4
Fixed comment. 2015-05-28 11:37:24 -04:00
irungentoo
441e007362
tox_new returns NULL on failure. 2015-05-25 15:20:38 -04:00
irungentoo
8e80ced6ce
Move savedata to options struct.
Add a way to select the type of savedata (normal savedata, load a
secret key, potentially others?) to load.
2015-05-22 18:23:56 -04:00
mannol
3100042a2b Updated with master 2015-05-22 23:22:31 +02:00
mannol
62c40af1a0 Added apidsl input file 2015-05-16 18:51:11 +02:00
irungentoo
3a28a8c5fb
Added basic TCP server hosting to tox.h api.
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
2015-05-08 22:03:24 -04:00
flan
045b510a14 fix useless use of cat 2015-04-26 09:57:50 +02:00
irungentoo
422e74424a
Switched tox.h to the dsl generated one.
Added input file to generate it.

Moved the astyle stuff to the astyle directory in other/.
2015-04-25 20:39:13 -04:00