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.
|
|
|
|
|
|
also add to "tox{,.in}.h" note that "tox.h" shouldn't be edited directly,
pointing to "tox.in.h"
|
|
Apparently it's not entirely clear that it's not needed in clients.
v2, as provided by @nurupo
|
|
|
|
|
|
|
|
|
|
Add a way to select the type of savedata (normal savedata, load a
secret key, potentially others?) to load.
|
|
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
|
|
Added input file to generate it.
Moved the astyle stuff to the astyle directory in other/.
|
|
|
|
|
|
also removed remnants of the no longer used variable ping_lastrecv
|
|
|
|
https://github.com/Raffinate/toxcore
|
|
|
|
|
|
They now have their own error codes.
|
|
|
|
|
|
|
|
|
|
|
|
Renamed tox_file_send_seek to tox_file_seek.
|
|
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.
|
|
transfers instead of 0.
For avatar transfers file size 0 now means that the client has no avatar
set.
Added a test for streaming transfers.
|
|
A couple of minor reasons, combined warrant a PR imo:
a) fileChunkRequested is a better signal name than fileRequestChunkReceived, and I don't want to break consistency by reordering words for just this signal
b) "request chunk" is parsed by English speakers as a verb-object combination,
implying sending the request, not receiving, whereas "chunk requested" is
parsed (more correctly) as an adjective-noun combo (in particular, request is
a noun not a verb), and thus reads far more like "hey heads up we just got a request"
For instance some tests/testing code had some callbacks to *receive* chunk requests, and they were called "tox_file_request_chunk"... to receive a chunk, not request it. Now they're called "tox_file_chunk_request".
So yeah...
|
|
|
|
new_api
|
|
|
|
messaging function.
This removes code duplication and allows us to easily add new message
types to the api without having to add new functions.
|
|
friend_get_connection_status
|
|
This is now documented in the API.
Ported programs in testing/ to this behaviour.
|
|
receive to recv in file receive functions.
Added TOX_MAX_FILENAME_LENGTH define.
|
|
|
|
|
|
|
|
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.
|
|
Pointer in callback will be NULL if length is 0.
|
|
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.
|