1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-28 05:21:00 +01:00

42 Commits

Author SHA1 Message Date
Michael Jones
ad94684b23
Use bool over int for the turnutils_uclient program (#1420)
Converts all of the variables in the uclient program that should be bool
but weren't.

A few other minor adjustments made at the behest of clang-tidy, but this
change does not address all of clang-tidy's complaints.
2024-05-29 20:39:51 -07:00
Michael Jones
544382f313
Fix mingw and MSVC ci build (#1491) 2024-05-27 13:43:40 -07:00
Michael Jones
da332ed9e7
Add the InsertBraces command for clang-format to ensure that all conditionals always have braces (#1408)
- Why? Because code where conditionals lack braces is much harder to read, and prone to indentation confusion.
- How? Just added an extra flag to .clang-format and re-ran clang-format on all the files.

I also moved .clang-format up to the top level of the repo so that it can be applied to the fuzz targets as well.
2024-01-27 16:38:40 -08:00
Gustavo Garcia
88ced47138
Replace srand/rand with srandom/random (#1279)
- srandom/random provide stronger randomness characteristics than
srand/rand in some operating systems.
- usage of srand/rand is not very consistent in coturn.

There is room for more refactoring and use apputils helper functions in
ns_turn_msg.c too but i'm not sure that dependency from "client" module
to "apps" module is a good idea yet.

Thx @0xdea

Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
2023-10-02 16:19:57 +02:00
Pavel Punsky
79fb65519c
Remove unused include that breaks OpenBSD (#1165)
PR #855 introduced new include <ssys/sysinfo.h> 
It is not required for compilation or turnserver function but breaks
OpenBSD build (which does not have this file)
This PR removes the include to restore OpenBSD build compatibility

Fixes #1162

Test Plan:
TBD - need some one to test build
2023-03-06 08:50:12 +01:00
Emil Ljungdahl
9fa8af6163
Use inline functions for errno checks (#1123)
Since winsock do not use errno, and have different error codes, this is
needed to be windows compatible

This pull request is a split of PR #1061
2022-12-22 11:10:34 -08:00
Pavel Punsky
95373d3e2a
Cleanup logs on turnserver start (#1088)
Reformatting and removing some duplications:
- Some lines have WARNING WARNING: cleaned up.
- Lines printed using perror: only LOG_ mechanism should be used.
- Printing IO mechanism (epoll for example) for each thread: selected
mechanism logged once
- Duplicate lines (perror and also LOG): duplication removed
- Duplicates: clean up (because calling function multiple times -
configuration load)
2022-11-14 17:45:20 -08:00
Gustavo Garcia
d9108a4b54
Add clang format rules and checks (#935)
I would like to get feedback on this and see if people is confortable
with these clang rules.

Right now is using the "llvm" style increasing the line length from 80
to 120 given that coturn is using long lines often.

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2022-11-06 22:05:17 +01:00
Gregor Jasny
83b8ddb744
Check and fix format string for turn_log_func_default (#1064) 2022-10-31 11:07:04 -07:00
Pavel Punsky
2716ed035a
Simplify defines for macOS platform (#1058)
`__APPLE__` is enough to detect macOS
2022-10-29 20:16:07 -07:00
Emil Ljungdahl
c4f670fa24
WINDOWS: unsigned long should not be used to store pointers (#1055)
On LLP64 systems (read Windows) unsigned long is only 4 bytes wide,
which makes it very unsuitable for storing pointers.
-----
Additional comments:
uintptr_t since c99 or uintptr_t since C++11
see: https://cplusplus.com/reference/cstdint/,
https://en.cppreference.com/w/c/types/integer,
https://en.cppreference.com/w/cpp/types/integer

C11 re-enabled in #1056
2022-10-29 20:13:25 -07:00
Pavel Punsky
af48249f29
Fix compilation warnings for functions with no arguments (#1053)
Function with no arguments must be defined as f(void) according to C
standard
2022-10-28 20:21:49 -07:00
Kang Lin
40c99db6ba
Support Windows MSVC (#855)
The following changes have been made:
1. Replace deprecated functions with new standard functions
2. Add corresponding MSVC functions for non-standard functions 
3. Remove warnings about unsafe functions
4. CMAKE: modify find pack Libevent and openssl 
5. Modify include files
6. Use pthread4W
7. Modify socket in windows
8. Add CI - github action
8.1. msvc
8.2. mingw
10. The database:
9.1. sqlite, pgsql, hiredis, mongo  is test compiled.
9.2. mysql, isnot test compiled.
11. The applications、server can be compiled and run successfully! 
12. Add vcpkg manifest mode in cmake.
2022-10-28 19:32:23 -07:00
Gregor Jasny
8c15f4bf23
Fix warnings (#1046)
Clang emitted some easy to fix warnings.
2022-10-25 09:28:46 -07:00
Pavel Punsky
d9e74af75d
Cleanup unused include of header files (#1004)
Using clang-tidy to detect unused header files

Inspired by #855

Test Plan:
- Rebuild all on mac, review no warnings/errors
- Pass builds/docker build - review for no issues
2022-10-05 10:28:40 +02:00
Pavel Punsky
bd9e44dd7c
Replace bcopy with memcpy (#991)
Replace all instances of `bcopy` with memcpy.

Inspired by https://github.com/coturn/coturn/pull/855
2022-09-20 10:39:11 +02:00
Pavel Punsky
ae259637eb
Replace bzero with memset (#986)
Replace all instances of `bzero` with memset by find-replace-edit.
This is straightforward replacement which is suboptimal in a few cases
(for example we could use calloc instead of malloc+memset(0))

Inspired by #855
2022-09-17 08:36:28 +02:00
Mészáros Mihály
991a82e104
Merge branch 'master' into master 2020-04-28 09:47:20 +02:00
Bertold Van den Bergh
ace903fd07 Add support for loadbalanced TCP connections (haproxy protocol v2) 2020-02-13 01:56:43 +01:00
chanduthedev
25338fa1c0 added null check for second char 2019-11-11 15:01:14 +08:00
islamoglus
82fbde71bd using SSL_get_version method for BoringSSL compatibility 2019-04-22 16:00:57 +03:00
Bradley T. Hughes
d2ee3ac291 Remove [su]{08,16,32,64}bits type defines
Do not overload the standard types with #defines, just use them
directly.
2019-03-08 09:08:30 +01:00
Bradley T. Hughes
7a43aae7c3 Remove ns_bzero(), ns_bcopy(), and ns_bcmp()
Do not overload bzero(), bcopy(), and bcmp() from strings.h
2019-03-07 08:39:20 +01:00
Bradley T. Hughes
043b102e38 Remove turn_strdup()
Do not overload strdup() from string.h
2019-03-07 08:00:08 +01:00
Bradley T. Hughes
b50fc77124 Remote turn_free()
Do not overload free() with a different API.
2019-03-07 07:58:12 +01:00
Bradley T. Hughes
fef016901e Remove turn_malloc()
Do not overload malloc() from stdlib.h
2019-03-06 23:38:20 +01:00
Oleg Moskalenko
51ca693359 SSLv3 support removed 2015-11-15 14:58:45 -08:00
Oleg Moskalenko
bd7937cb45 working on openssl compatibility without SSLv3 2015-10-11 18:51:26 -07:00
mom040267
6dbee00b74 working on new third-party auth draft 2015-04-19 07:37:12 +00:00
mom040267
86f40b4bd9 working on third-party auth 2015-04-19 06:18:28 +00:00
mom040267
948a61d250 SCTP fixes. 2015-04-03 06:54:10 +00:00
mom040267
8662de6d73 sctp fixes 2015-04-02 05:32:46 +00:00
mom040267
0496635edd fixing SCTP on Linux 2015-03-15 21:08:31 +00:00
mom040267
2e0b8aefcc TOS fixed 2015-02-04 06:14:11 +00:00
mom040267
b3098cd71d ssl2 removed 2015-01-10 23:29:08 +00:00
mom040267
94c3c57456 DTLS code cleaning 2014-12-12 10:23:18 +00:00
mom040267
65dc483208 tls code cleaning 2014-12-11 08:19:29 +00:00
mom040267
c810a2332e tls code cleaning 2014-12-10 16:55:21 +00:00
mom040267
786105a9b4 DTLS v1.2 supported. 2014-12-09 09:29:27 +00:00
mom040267
5177adb626 memory debug 2014-10-10 17:24:19 +00:00
mom040267
0e85945afa cleaning 2014-09-16 06:20:15 +00:00
mom040267
702b29bc22 initial code import 2014-04-20 21:10:18 +00:00