- 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.
Co-authored-by: KORAY VATANSEVER <koray.vatansever@turkcell.com.tr>
Some events are missed when logs are filtered by session ID. That's why I added the sessionID to some log lines.
The flowchart will be kept updated:
- Use [drawio](https://app.diagrams.net/) to edit.
1. Open [drawio](https://app.diagrams.net/) in brower
2. Menu → File → Open from ... → Device:
Select [FlowChart.html](FlowChart.html)
3. Edit flow chart
4. Export to svg:
Menu → File → Export as... → SVG...
Co-authored-by: CUMHUR KARAHAN <cumhur.karahan@turkcell.com.tr>
Added session id parameter to use it in "A peer IP denied in the range" logs. Besides, server ID has been made visible in this logs.
Before
```
023-08-24T17:23:17.221745770+03:00 stdout F 268472: : ERROR: A peer IP 169.254.38.68 denied in the range: 169.254.0.0-169.254.255.255
```
And after - new view:
```
2023-09-28T10:53:49.627778472+03:00 stdout F 1247: : ERROR: session 006000000000000004: A peer IP 172.21.198.41 denied in the range: 172.21.198.40-172.21.198.50 in server 6
```
- update lukka/run-vcpkg@11
- vcpkg 2023-11-16 Release (new version was required anyway but taking somewhat newer but not latest)
- lukka/run-vcpkg@11 documentation states cache is not needed so deleted anything related to caching
Test plan: edited yaml file to run msvc job on PR and confirmed that it passes successfully
Co-authored-by: Evgeny Khramtsov <evgeny.khramtsov@ringcentral.com>
If IPv6 is not enabled during runtime, prometheus server fails to start with `EAFNOSUPPORT` because `MHD_USE_DUAL_STACK` is set unconditionally.
This PR fixes it. As a bonus, it also checks if libmicrohttpd is compiled with IPv6 support.
Fixes#1266
According to RFC 5766, [section 6.2](https://www.rfc-editor.org/rfc/rfc5766#section-6.2) point no. 5, the turn server needs to reject the request with 508 (Insufficient Capacity) error code when the given RESERVATION-TOKEN is not valid.
For our deployment, it is useful if coturn returns a valid HTTP response to an HTTP request. To do this on the same port as STUN/TURN and without enabling the admin site, I have extended `read_client_connection()` to return a canned HTTP response, in response to an HTTP request, rather than immediately closing the connection.
Fixes#1259
If `ur_string_map_put ` fails then the string that was just `strdup`-ed
will leak memory
Now the return value is checked and memory free-ed in case of failure
- 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>
Add missing checks for length of realm/nonce/server_name before copying
those values to the buffer passed to stun_is_challenge_response_str.
The function stun_is_challenge_response_str is only used in uclient test
application.
Thank you very much @0xdea
Co-authored-by: Gustavo Garcia <gustavogb@mail.com>