Commit Graph

78 Commits

Author SHA1 Message Date
iphydf
ad26560516
Improve static and const correctness.
- 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-06 11:54:37 +01:00
iphydf
a9fbdaf46b
Do not use else after return.
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-09-02 11:02:56 +01:00
iphydf
77db27331e
Sort #includes in all source files. 2016-09-01 16:35:46 +01:00
iphydf
633da98ae6
Add braces to all if statements. 2016-08-31 20:04:16 +01:00
iphydf
13ae9e9a93
Move logging to a callback.
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
2016-08-27 01:16:14 +01:00
iphydf
6935643f9a
Fix some compiler warnings. 2016-08-18 17:10:15 +01:00
Tibor Stolz
edbfca5474 fix BWController misspelling 2015-11-11 10:33:03 +01:00
Jfreegman
c019c6236e
Prevent debug message from spamming stdout 2015-11-04 21:00:00 -05:00
irungentoo
6a494e2cbd
Astyle. 2015-11-03 13:42:05 -05:00
Eniz Vukovic
d6fdf16520 New Adaptive BR algorithm, cleanups and fixes 2015-10-10 23:54:23 +02:00
mannol
c641b0fceb Updated with upstream 2015-08-09 12:39:21 +02:00
mannol
657a57b406 Fixed memory leak during session cleanup and fixed naming. 2015-08-07 02:04:04 +02:00
irungentoo
553f3ea513
Fixed some strange build issues. 2015-07-20 22:21:53 -04:00
mannol
6c126e34e6 Implement handling capability change on rtp level 2015-06-30 01:41:38 +02:00
mannol
73fbc22961 Fixed inconsistencies 2015-05-07 23:14:03 +02:00
mannol
b2b11f0fba Added many test and fixed various warnings 2015-04-30 00:40:30 +02:00
mannol
9bba7a0434 Done 2015-04-29 01:01:25 +02:00
mannol
e4a020333d working av new api 2015-04-28 00:55:57 +02:00
mannol
27e0254a98 Almooooooost 2015-04-27 00:15:57 +02:00
mannol
144fc94d69 Almost done 2015-04-26 00:31:03 +02:00
mannol
1bfd93e64a Finished refactoring 2015-04-22 02:09:37 +02:00
mannol
3fd0ee5f08 Final touchups 2015-04-21 02:31:12 +02:00
mannol
d1fd3e36a6 Updated with upstream 2015-04-17 19:19:58 +02:00
mannol
da6c17222f The pretty basic adaptive bitrate is *working* 2015-04-16 02:00:34 +02:00
mannol
2465f486ac Started custom RTCP 2015-04-13 01:45:53 +02:00
mannol
62af82705a Some progress 2015-03-22 23:50:43 +01:00
irungentoo
e5791ed9ef
Added different error codes for custom packet functions in Messenger. 2015-02-26 13:13:26 -05:00
irungentoo
33370edee6
Changes to custom packet functions in Messenger.
Added function for rtp A/V packets, modified functions to behave
correctly for the new api.
2015-02-26 08:05:57 -05:00
mannol
29601feb76 New msi protocol 2015-02-21 01:07:22 +01:00
mannol
483a6ffa32 Added 2 new headers into msi for buffer control 2015-02-17 23:34:40 +01:00
irungentoo
c6a59e64b7
Updated types in Messenger callbacks to fit with the ones in the new api.
Friend number changed from int32_t to uint32_t.
Some lengths changed to size_t.
2015-02-17 15:49:22 -05:00
mannol
39680f31d0 Progress 2015-02-01 23:43:54 +01:00
mannol
1450c22d01 Current progress 2015-01-24 23:29:54 +01:00
irungentoo
7d27893f1a
Merge branch 'more_consistent_custom_packet_handlers' of https://github.com/wrouesnel/toxcore 2014-12-09 16:39:52 -05:00
Will Rouesnel
8a56cb3b58 Change prototype for custom_packet_handler functions
Change the custom_packet_handler callback function interface to be
consistent with other callback interfaces.

The new interface takes the Messenger object calling as the first
parameter, and moves the user data object to be the last parameter. 

This makes it comparable to the callbacks for file transfer and the
like, and should simplify building interfaces.

The new prototype is: int (*)(Messenger *m, int32_t friendnumber, const
uint8_t *data, uint32_t len, void *object)
2014-12-09 07:51:49 +11:00
irungentoo
8deb032b2d
Merge branch 'mutex-1' of https://github.com/mannol/toxcore 2014-11-29 16:09:24 -05:00
mannol
e62ded3a6d More av cleanup 2014-11-29 13:42:19 +01:00
irungentoo
279c33c01a
Merge branch 'master' of https://github.com/mannol/toxcore 2014-11-24 20:24:59 -05:00
mannol
386c9748d4 av refactor 2014-11-18 00:46:46 +01:00
sin
a46810a197 Rework toxav/rtp.c to use ntohl/htonl and ntohs/htons
Now we can also remove the helper routines from toxcore/util.[ch].
2014-09-30 13:18:28 -04:00
mannol
733c509582 Fix some toxav warnings 2014-08-04 00:15:00 +02:00
irungentoo
d052bbc3eb
Start sequence number at zero instead of one. 2014-07-25 10:39:34 -04:00
mannol
79115259a8 Fixed conflicts 2014-07-21 04:10:05 +02:00
mannol
1aeeef58b2 Improved protocol and cleaned code a bit 2014-07-21 01:10:57 +02:00
notsecure
3d4de767fe use callbacks for a/v 2014-07-07 16:10:10 -04:00
irungentoo
a51f6bbd69
Merge branch 'mannol1-master' 2014-07-05 12:25:30 -04:00
mannol
ebdc236d51 Fixed conflicts 2014-07-05 15:13:55 +02:00
mannol
8b9d3992a4 Make rtp & codec actions thread-safe 2014-07-05 15:11:25 +02:00
irungentoo
83b9fbc1dc
Fixed out of bounds read.
payload_type seems to be completely useless and should be removed.
2014-07-04 19:09:50 -04:00
irungentoo
c4f0650ae3
Fixed const related warnings. 2014-07-02 16:04:41 -04:00