Commit Graph

3353 Commits

Author SHA1 Message Date
irungentoo
24c70c9e84
Added and implemented file_id parameter to file tranfers.
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-17 13:44:48 -04:00
irungentoo
2757b254fe
Merge branch 'iphydf-new_api' into new_api 2015-03-16 09:26:05 -04:00
iphydf
fa7c21f95c New API fixups. 2015-03-16 13:12:25 +00:00
irungentoo
08585e5b60
Merge branch 'new_api_patch' of https://github.com/Impyy/toxcore into new_api 2015-03-15 18:41:00 -04:00
irungentoo
ec659491b2
Avatar hash is now the filename of the file transfer instead of the
first 32 bytes.

Enforce length of filename in core when transfer is an avatar type
transfer to make things more safe.
2015-03-15 18:35:22 -04:00
Impyy
409897f7ae Initialize Tox_Options with default values in tox_options_new 2015-03-15 12:47:59 +01:00
irungentoo
518a399eb0
There are many scenarios where the user would want to modify the
contents pointed by proxy_address.
2015-03-14 13:35:50 -04:00
irungentoo
fab2daf57a
Install tox_old.h too. 2015-03-14 10:54:42 -04:00
irungentoo
6cf7270638
Make nTox save on exit. 2015-03-14 10:05:39 -04:00
irungentoo
a1127e63d5
Better DHT distance function. 2015-03-14 10:03:19 -04:00
irungentoo
11e8e8bd3a
When link can't send packets anymore, stop the request chunk callback.
Removed time variable in packet struct and replaced it with sent
variable.
2015-03-13 16:51:41 -04:00
irungentoo
29857a3da4
This belongs in the previous commit. 2015-03-13 16:33:55 -04:00
irungentoo
c3e07b73d3
Remove TOX_FILE_KIND typedef. 2015-03-13 15:38:44 -04:00
irungentoo
8e2957ec50
Merge branch 'newer_api' of https://github.com/dubslow/toxcore into new_api 2015-03-13 15:29:34 -04:00
Dubslow
64fefb6f43
revert to TOX_FILE_KIND 2015-03-13 12:34:14 -05:00
irungentoo
96d9cef66c
File kind is now a uint32_t.
This allows clients to agree on what numbers mean what without having
it be set in core.
2015-03-13 13:00:35 -04:00
irungentoo
669975c226
tox_file_send_chunk() must now send data the same length as requested
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.
2015-03-13 12:40:21 -04:00
irungentoo
eec1042695
tox_friend_get_public_key() now does nothing when public_key is NULL. 2015-03-13 08:36:07 -04:00
Dubslow
3bf259f69d Convert core code depending on the api 2015-03-12 18:23:14 -05:00
irungentoo
334cb9c8db
Check more ports in tox_test.c 2015-03-12 19:04:49 -04:00
irungentoo
b4320e5fac
File sending improvements.
Use correct double to integer conversion.
2015-03-12 18:56:33 -04:00
irungentoo
0d67598aed
File transfer fixes and improvements. 2015-03-12 18:01:08 -04:00
irungentoo
7e5ca487b5
Don't assume tox_file_send_chunk() is called in the request chunk
callback.
2015-03-12 16:05:18 -04:00
irungentoo
8dc2db2025
Added position parameter to tox_file_send_chunk().
This is done so that the function now has the same parameters as the
request chunk callback.
2015-03-12 15:17:34 -04:00
irungentoo
28d707662b
Fixed tox_new issue. 2015-03-12 13:11:28 -04:00
irungentoo
7afab000f7
tox_new now sets error to TOX_ERR_NEW_PORT_ALLOC when binding to port fails. 2015-03-12 13:03:14 -04:00
irungentoo
4ee017078b
tox_new() fixes.
If data is NULL and length non zero, TOX_ERR_NEW_NULL is set.

error is set to TOX_ERR_NEW_LOAD_BAD_FORMAT when load fails.
2015-03-12 12:19:59 -04:00
irungentoo
1eca7b8e67
Added simple status message test to tox_test.c 2015-03-12 12:18:52 -04:00
irungentoo
4ad7649788
Merge branch 'aaannndddyyy-patch-1' 2015-03-11 20:41:01 -04:00
Dubslow
91274495bc
This is a combination of 11 commits.
The first commit's message is:
TOX_STATUS -> TOX_USER_STATUS, is more specific

  This is the 2nd commit message:

I pretty strongly believe tox_iteration needs to be renamed to a verb

There are several other noun functions in the API, but none of them *do* things.
I think even tox_do is better than tox_iteration.

tox_do_interval is one possibility, but I'm open to suggestions.

  This is the 3rd commit message:

private_key -> secret_key

This is more consistent with modern/NaCl/elliptic cryptography, and also "pk", meaning public key, is all over other toxcore code and documentation. This will eliminate ambiguity.

  This is the 4th commit message:

Rename some functions for pseudo-namespace consistency

The enum change results in long enum types, but I think consistency trumps
having a few less characters.

  This is the 5th commit message:

TOX_FILE_KIND -> TOX_FILE_TYPE

This is more of an English thing than a consistency thing, but
TOX_FILE_KIND sounds funnier/stranger to me than TOX_FILE_TYPE.

  This is the 6th commit message:

More specific file control function names

  This is the 7th commit message:

Rename custom packet functions for pseudo-namespace consistency

This also has the issue with long enums... but I still think consistent enum names are better

  This is the 8th commit message:

Rename functions for pseudo-namespace consistency

  This is the 9th commit message:

Consistency with https://github.com/sonOfRa/tox4j/blob/master/doc/core-design.md#naming-conventions and the rest of the api

  This is the 10th commit message:

Fix errors in previous function rename commits

  This is the 11th commit message:

Shorten one error enum name
2015-03-11 17:09:06 -05:00
irungentoo
43fe6e71bd
tox_callback_connection_status() implemented.
Attempted fix of connection checking to make it more stable.
2015-03-11 15:37:25 -04:00
irungentoo
572484f06e
Use .h for tox_old instead of .c to not break some of my build commands. 2015-03-11 13:51:11 -04:00
irungentoo
88a8a079b6
Implemented the 3 low level network information functions.
Added tox_get_udp_port() to tests.
2015-03-11 08:09:45 -04:00
irungentoo
916b6aa734
Added group chat functions to the public api.
Since the functions are not new api like I put them in tox_old.{c,h}
2015-03-10 18:54:01 -04:00
irungentoo
8e55d96381
Ported nTox to new file transfer api. 2015-03-10 18:49:06 -04:00
irungentoo
c434d48579
testing/tox_sync now fully works on the new api. 2015-03-10 18:29:10 -04:00
irungentoo
0207fcdfb0
Implementation of new api file transfers.
Everything should work except resuming.
2015-03-10 17:31:50 -04:00
irungentoo
f5eca31637
Fixed small issue. 2015-03-09 20:59:50 -04:00
irungentoo
576e5ee703
Updated new_filesender function in Messenger.c 2015-03-09 19:21:51 -04:00
irungentoo
4c4ffb7409
Fixed case where a recv and a sending file would have the same number.
recv file numbers are now (file num in packet + 1) << 16
2015-03-09 14:32:37 -04:00
irungentoo
73b9cf48f9
Merge branch 'worfox-new_api' into new_api 2015-03-08 19:08:33 -04:00
Christoffer Sterner
3315fd2571 Change LOGGER_DEBUG to LOGGER_ERROR for fail bind 2015-03-07 23:45:00 +01:00
Christoffer Sterner
10ca292f24 Change fprintf debug into LOGGER_DEBUG for consistency 2015-03-07 22:39:27 +01:00
irungentoo
2af1608059 Fixed debug fprintf. 2015-03-07 16:16:25 -05:00
irungentoo
14af278ca8
Updated File request packet to new format.
[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.
2015-03-06 22:06:58 -05:00
irungentoo
20090ea661
Fixed typedef. 2015-03-06 21:37:00 -05:00
irungentoo
f66f9fe76e
enums are no longer typedefed to uint8_t. 2015-03-05 12:49:38 -05:00
irungentoo
ac7da66529
Code cleanups.
Fixed wrong variable used, removed useless elements of struct.
2015-03-05 12:30:50 -05:00
aaannndddyyy
c955728ac7 spelling, punctuation, ... 2015-03-05 10:54:42 +00:00
aaannndddyyy
1e17b468e6 minor punctuation fixes
only minor punctuation fixes. not changed the wording, except for one 'logical typo'.
2015-03-05 09:19:35 +00:00