Age | Commit message (Collapse) | Author |
|
|
|
These functions are akin to the tox_count_friendlist and tox_copy_friendlist, made available on the public API.
|
|
Significantly trimmed down version of an ID<=>IP cache.
|
|
|
|
entries).
id_hash() was not at all working as expected for very small bucket size (when (size / 4) was zero). Simplified to be trivially correct.
Also added a used flag on adding an entry, which is set by callers if they have that association in active use. Those get priority over unused entries on collision.
Fleshed out test to be at least elementary useful.
Each group chat now uses an own, small assoc (80 entries).
|
|
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
|
|
|
|
into FullName-group_peername
|
|
(Seriously...)
group_chats.*:
- group_send_nick() to send own name
- setnick() to store a received name
Messenger.c:
- group_send_nick() before group_sendmessage() (in regular intervals, to inform new peers)
nTox.c:
- print_groupmessage(): on error or on a name of length zero the result of tox_group_peername() isn't null-terminated, catch that
|
|
- multiple places: tox_getname() doesn't terminate the string, make sure nTox does
- format_message():
. - renamed to print_formatted_message()
. - changed semantics: does the new_line() itself, saves caller from freeing the buffer (which no caller did)
. - changed signature: now also prints the friend's name when sending
. - intern: date is only printed once, the message line gets only time
- print_message(): enforce null termination
- main():
. - setlocale() to init locale (for date/time printing)
. - own name: ensure null termination
Messenger.c:
- notify of friend name change *before* the old name is overwritten
|
|
DHT_test now only prints non zero entries.
|
|
|
|
|
|
I'm sure nobody has any of the old save files anymore so I removed the
functions.
|
|
cleanup_unix_time_id_eq_cpy_is_timeout
Conflicts:
toxcore/net_crypto.c
|
|
unix_time():
- returns local value for current epoch
- value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT()
is_timeout():
- uses the local value for current epoch
id_cpy()/id_eq() => id_copy()/id_equal():
- centralized duplicate definitions
- replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
|
|
|
|
|
|
https://github.com/FullName/ProjectTox-Core into FullName-Cleanup-defines
|
|
always off).
Additionally (besides cleanups):
network.h/tox.h:
- WIN32: fix a strange sa_family_t definition
- WIN32: define EWOULDBLOCK to WSAEWOULDBLOCK
- WIN32: kill macro for an existing function (IN6_ADDR_EQUAL)
network.c:
- use EWOULDBLOCK instead of EAGAIN (same value, but EWOULDBLOCK is more "popular")
- new_networking(): only try to enable IPv4-in-IPv6 if it's not already enabled per default
- inet_ntop()/inet_pton(): WIN32: remove partial initializers in favor of a simple memset()
- ip_equal(): WIN32: use an existing function
- logging: networking_wait_execute(): only dump result if not timeout
- logging: loglogdata(): kill an unused variable
LAN_discovery.c:
- send_broadcasts(): re-enabled, can only support IPv4 by principle, split into fetch_broadcast_info() (to fetch the addresses once) and send_broadcasts() (actual sending)
DHT.c:
- DHT_load_state_callback(): enclosed a fprintf(stderr, ...) into #ifdef DEBUG
Lossless_UDP.c:
- change_handshake(): harden against strange sa_family_t definitions
Messenger.c:
- logging: fix ID to string conversion
util.c:
- logging: eliminate a signed-warning
|
|
|
|
Added functions to send/receive msi packets via secure messenger
connections.
Made function to get the ip/port of a friend in Messenger.c public
|
|
|
|
with Tox *tox in tox.c (which now includes the declarations from tox.h)
|
|
sendpacket() sets a timestamp if it happened
network.*:
- sendpacket(): checks result and on EAGAIN, stores time of this event
- networking_wait_prepare(): uses the time if set to check up to 500ms later for the socket to be writeable again
- networking_wait_cleanup(): clears the time if the socket was writeable
- fixed some accidental tabs
Messenger.*, tox.*:
- pass-through functions to reach networking_wait_cleanup()
- fixed some accidental tabs
|
|
|
|
|
|
To allow the actual waiting to run without any locking, split it into preparing the data it uses and the execution of the wait.
The caller must provide with the buffer to store whatever data it requires to wait.
Completely eliminates any reliance on the existence of anything but that data in the actual wait routine.
Also fixed a few argument type warnings inside LOGGING.
|
|
|
|
|
|
Lossless_UDP.*:
- sendqueue_total() sums sendqueue() across all connections
network.*, Messenger.c:
- sendqueue_total() is collected and then used in deciding if we select() on write-readiness
|
|
https://github.com/irungentoo/ProjectTox-Core into file-transfers
|
|
|
|
tox.*, Messenger.*, network.*;
- new function tox_wait() => waitMessenger() => networking_wait():
- waits for a given amount of time for any sort of socket activity
- mustn't change anything inside, mustn't poll or do other stuff
- the point is to be able to call this asynchronously from a second thread
- the outside shall follow up with an immediate tox_do() when there's socket activity
tox.*:
- allow inclusion of tox.h into tox.c, ensuring that the outside interface and the internal always match
util.c:
- squished a few warnings about questionable format strings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
into FullName-ClientData46
|
|
|
|
|
|
Compilerflag: CLIENT_ONETOONE_IP (to define in DHT.h, default unset i.e. NEW case: two addresses)
Every function in DHT{_test}.c working on Client_data has been rewritten to store IPv4 addresses in assoc4, IPv6 addresses in assoc6.
Loading/Storing of states defined with other compiler switch is transparently adjusting to the differences.
DHT.h, DHT.c:
- introduction and handling of the structure changes
DHT_test.c, Messenger.c:
- logging adapted to new structures
util.h:
- LOGGING isn't undefined per default anymore
|
|
|
|
made setfriendname() part of public api
|
|
|
|
|
|
|