summaryrefslogtreecommitdiff
path: root/toxcore/network.c
AgeCommit message (Collapse)Author
2014-06-01Fixed TOX_MAX_MESSAGE_LENGTH define.irungentoo
Removed some useless code from toxcore. Astyled core code with new version of astyle.
2014-05-28Check for CLOCK_MONOTONIC_RAWAnsa89
This should fix irungentoo/ProjectTox-Core#879 (and it's better than irungentoo/ProjectTox-Core#883).
2014-05-25Merge branch 'mannol1-Multicalls' into multi-avirungentoo
2014-05-20Merge upstream and other stuffmannol
2014-05-19mistakesnotsecure
forgot to build before pushing
2014-05-19IP_Port packing unpacking in onion.cnotsecure
2014-05-18libsodium header should only be included when libsodium is used.irungentoo
2014-05-18Fix current_time_monotonic on OS X.stal
clock_gettime doesn't exist there, so throw in some equivalent mach stuff.
2014-05-16This works.mannol
2014-05-08Merge branch 'master' into TCPirungentoo
2014-05-08Fixed major denial of service issue.irungentoo
2014-05-03All time in core is now monotonic.irungentoo
2014-05-01Random number functions belong in crypto_core.irungentoo
2014-04-27Yeah many callsmannol
2014-04-25Fixed issue.irungentoo
2014-04-13sockets: support Mac OS X way of disabling SIGPIPE on a socketSteven Noonan
Mac OS X doesn't have MSG_NOSIGNAL, so we need to use SO_NOSIGPIPE. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2014-04-06Added TCP_client.irungentoo
Some work done on the TCP part.
2014-04-02Some code cleanups.irungentoo
2014-03-18Merge branch 'api-fix'irungentoo
Main changes: 1. Strings no longer need to be NULL terminated. 2. tox_get_friend_id is now named tox_get_friend_number. 3. The friend request callback function is now (Tox *tox, uint8_t *, uint8_t *, uint16_t, void *), the Tox object pointer has been added to it.
2014-03-16Friend request callback now contains the Tox object.irungentoo
2014-03-15A bit of work done on the TCP relay server.irungentoo
2014-03-12updated compilation and execution instructions for Lossless UDP tests, and ↵Kelong Cong
fixed minor typos
2014-03-07Some tox_wait_* improvementsMaxim Biro
2014-02-25Allow to optionally use randombytes_stir() instead of sodium_init()Jin^eLD
According to sonOfRa sodium_init() has some timing issues on Android. libsodium people said randombytes_stir() can be used instead: https://github.com/jedisct1/libsodium/issues/121 sodium_init() stays the default, randombytes_stir() can be enabled by passing --enable-randombytes-stir to the configure script.
2014-02-10Fixed possible memory leak.irungentoo
2014-01-30Convert IPv4 in IPv6 to IPv6 address in recieve packet.irungentoo
2014-01-20Update network.cbenwaffle
2014-01-19proper windows preprocessor detectionBen Iofel
2014-01-05Tests added and some fixes for the onion part.irungentoo
2013-12-15Code cleanups.irungentoo
No functionality changed.
2013-12-12Fixed arm bug.irungentoo
2013-11-29Add sodium_init() function to startup.irungentoo
2013-11-27Various changes to nTox including a potential crash (also possible from ↵Coren[m]
remote!), and a tiny change to toxcore. Crash stuff: nTox.c: - do_refresh(): avoid crashes (input a "%" and the client goes "boom!", send someone a string with embedded "%" and see him blow up...) Other stuff: toxcore: tox.h (doc.)/network.c (code): - networking_wait_prepare(): return -1 if lenptr was NULL and therefore not settable nTox.c: - fraddr_to_str(): function to convert a TOX_FRIEND_ADDRESS into a segmented (and therefore line-breakable) string - print_friendlist(): print index of friend on name line, print id on 2nd line - command /f: skip spaces (and +) inside a friend id - command /r (new): "/r #" to remove a friend - main(): reduce cpu consumption if we're not currently sending files
2013-11-16Fixed build error on windows.irungentoo
2013-10-25Update time before running functions for recieved packets.irungentoo
2013-10-20Merge branch 'Cleanup-defines' of ↵irungentoo
https://github.com/FullName/ProjectTox-Core into FullName-Cleanup-defines
2013-10-20Main: Eliminate TOX_ENABLE_IPV6 (then always on), CLIENT_ONETOONE_IP (then ↵Coren[m]
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
2013-10-19fixed build errors on windowsAntonio Montes
2013-10-13Small fix.irungentoo
2013-10-13tox A/V: integration of A/V code into toxmannol
Also-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
2013-10-09fix for missing EAGAIN definition on windowsnaxuroqa
2013-10-06sendqueue_length no longer determines if we check for socket-can-write, but ↵Coren[m]
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
2013-10-05Broken *_wait() into *_wait_prepare() and *_wait_execute()Coren[m]
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.
2013-10-03Only add write-ready to select() if we have packets queuedCoren[m]
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
2013-10-02Add tox_wait() for socket, allow tox.h include in tox.cCoren[m]
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
2013-09-22Astyled network.cirungentoo
2013-09-22Fix inet_pton/ntop on win32BtbN
2013-09-21Fix compilation on windows for ipv6 codeBtbN
2013-09-20Increased the size of the UDP buffers.irungentoo
2013-09-18Allow loginit() to be delayed, store loglog() data in intermediate buffer ↵Coren[m]
and flush it out when loginit() is called util.c: - handle loglog() before loginit() by storing the lines into an expanding buffer - when loginit() is called, write out and kill the buffer network.c: - push loginit() to the point where we know the actually used port