Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
Attempted fix of connection checking to make it more stable.
|
|
Everything should work except resuming.
|
|
|
|
[uint8_t packet_id (PACKET_ID_FILE_SENDREQUEST)][uint8_t file_number]
[uint32_t type][uint64_t file_size][filename (currently max 255 bytes)]
recv file numbers are << by 16 to distinguish them from sending files.
|
|
|
|
Fixed wrong variable used, removed useless elements of struct.
|
|
new_api
|
|
That function should be static.
|
|
|
|
|
|
Added function for rtp A/V packets, modified functions to behave
correctly for the new api.
|
|
The new api sees avatars as a different type of file transfer.
|
|
Internal message functions now return better error codes.
|
|
|
|
Changes in Messenger to call the callback every time the connection
type changes from TCP to UDP.
|
|
|
|
|
|
Friend number changed from int32_t to uint32_t.
Some lengths changed to size_t.
|
|
Removed unknown error.
norequest function now returns proper error codes.
|
|
m_copy_self_statusmessage no longer takes a buffer length argument.
|
|
|
|
|
|
|
|
|
|
https://github.com/wrouesnel/toxcore
|
|
Change the custom_packet_handler callback function interface to be
consistent with other callback interfaces.
The new interface takes the Messenger object calling as the first
parameter, and moves the user data object to be the last parameter.
This makes it comparable to the callbacks for file transfer and the
like, and should simplify building interfaces.
The new prototype is: int (*)(Messenger *m, int32_t friendnumber, const
uint8_t *data, uint32_t len, void *object)
|