summaryrefslogtreecommitdiff
path: root/testing/tox_sync.c
AgeCommit message (Collapse)Author
2018-01-14Fix some memory or file descriptor leaks in test code.iphydf
Also some missing return value checks for `fopen`.
2017-03-25Move c_sleep to helpers.h and misc_tools.hDiadlo
Also fix a mistake with forgotten braces around parameter
2017-01-28Add VLA compatibility macro for C89-ish compilers.iphydf
2017-01-19Update license headers and remove redundant file name comment.iphydf
"All rights reserved" was incorrect. The project was licensed under GPL3, which means a lot of rights are licensed to everybody in the world, i.e. not reserved to the "Tox Project".
2017-01-06Revert "Revert "Portability fixes""David Zero
This reverts commit 59e2a844f04a8725e8079f854158aa86ef5988b2, and defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-05Revert "Portability fixes"endoffile78
This reverts commit f3469070fe899e8e4fd88665386a55bad9f77cd8.
2017-01-04Portability fixesDavid Zero
- CFLAG gnu99 was changed to c99. - CXXFLAG c++98 was changed to c++11. - CFLAG -pedantic-errors was added so that non-ISO C now throws errors. - _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3 and c99 definitions in modules that required them. - Fixed tests (and bootstrap daemon logging) that were failing due to the altered build flags. - Avoid string suffix misinterpretation; explicit narrowing conversion. - Misc. additions to .gitignore to make sure build artifacts don't wind up in version control.
2016-09-30Remove return after no-return situation (and other cleanups).iphydf
Cleanups: - Fix header guards to not use reserved names. - Avoid name shadowing. - Removed an unused variable found by avoiding name shadowing.
2016-09-10make the majority of the callbacks stateless and add some status to a testcasemichael bishop
2016-09-06Improve static and const correctness.iphydf
- Any non-externally-visible declarations should be `static`. - Casting away the `const` qualifier from pointers-to-const is dangerous. All but one instance of this are now correct. The one instance where we can't keep `const` is one where toxav code actually writes to a chunk of memory marked as `const`. This code also assumes 4 byte alignment of data packets. I don't know whether that is a valid assumption, but it's likely unportable, and *not* obviously correct. - Replaced empty parameter lists with `(void)` to avoid passing parameters to it. Empty parameter lists are old style declarations for unknown number and type of arguments. - Commented out (as `#if DHT_HARDENING` block) the hardening code that was never executed. - Minor style fix: don't use `default` in enum-switches unless the number of enumerators in the default case is very large. In this case, it was 2, so we want to list them both explicitly to be warned about missing one if we add one in the future. - Removed the only two function declarations from nTox.h and put them into nTox.c. They are not used outside and nTox is not a library.
2016-09-02Do not use `else` after `return`.iphydf
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-17Make self_connection_status callback stateless.iphydf
**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.
2015-05-22Move savedata to options struct.irungentoo
Add a way to select the type of savedata (normal savedata, load a secret key, potentially others?) to load.
2015-03-21Renamed tox_file_send_control to tox_file_control.irungentoo
Renamed tox_file_send_seek to tox_file_seek.
2015-03-19callback_file_request_chunk -> callback_file_chunk_requestDubslow
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...
2015-03-18Merge branch 'one_more_rename' of https://github.com/dubslow/toxcore into ↵irungentoo
new_api
2015-03-18Move get_connection_status to self pseudonamespace, to contrast ↵Dubslow
friend_get_connection_status
2015-03-18When friend goes offline all his file transfers get removed.irungentoo
This is now documented in the API. Ported programs in testing/ to this behaviour.
2015-03-18Api changes.irungentoo
receive to recv in file receive functions. Added TOX_MAX_FILENAME_LENGTH define.
2015-03-17Added and implemented file_id parameter to file tranfers.irungentoo
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.
2015-03-13Remove TOX_FILE_KIND typedef.irungentoo
2015-03-13Merge branch 'newer_api' of https://github.com/dubslow/toxcore into new_apiirungentoo
2015-03-13revert to TOX_FILE_KINDDubslow
2015-03-12Convert core code depending on the apiDubslow
2015-03-12Added position parameter to tox_file_send_chunk().irungentoo
This is done so that the function now has the same parameters as the request chunk callback.
2015-03-10Ported nTox to new file transfer api.irungentoo
2015-03-10testing/tox_sync now fully works on the new api.irungentoo
2015-02-24Ported some of the code in testing/ to the new api.irungentoo
2014-08-14Modified tox_bootstrap_from_address() function.irungentoo
PORT IS NO LONGER PASSED IN NETWORK BYTE ORDER. Removed useless ipv6enabled parameter.
2014-08-14Added disabling of UDP and basic SOCKS5 proxy support to public API.irungentoo
tox_new() now takes a Tox_Options struct as argument. If a NULL pointer is passed to that struct, defaults are used.
2014-06-30Const correctness for toxcore/Messenger.c and related filesMarc Schütz
2014-06-13Attempt fix of tox_sync not building on some systems.irungentoo
2014-05-28Fixed Tox sync.irungentoo
2014-02-09Astyled and removed some useless files.irungentoo
2014-02-09Fixed memory leaks and removed repeated codeMaxim Biro
2013-12-16Astyled the code.irungentoo
2013-11-29Fix typo.AZ Huang
2013-11-29Fix API name consistency.AZ Huang
2013-10-08Added function to get the piece size for sending files.irungentoo
2013-10-05Fixed warnings.irungentoo
2013-10-05Tox sync added.irungentoo
Tox sync is a proof of concept bittorrent sync inspired application that uses tox to sync the contents of two folders. Currently only works on POSIX compilant operating systems.