17 Commits

Author SHA1 Message Date
Cameron Gutman
c0e3dc64a4 Add basic QoS attributes to our A/V sockets 2024-02-01 00:15:47 -06:00
Cameron Gutman
05c3f9c754 Bind our UDP sockets to the same local address used by RTSP handshake
This means we can ensure a consistent local address for our outgoing PING
traffic to keep the UDP flows alive without having to call connect() which breaks
with multi-homed hosts on GFE and Sunshine v0.20 and earlier.
2023-10-26 01:09:26 -05:00
Cameron Gutman
8b84d17c8d Replace additional unsafe string functions 2023-10-06 17:33:37 -05:00
Cameron Gutman
77c5d5c282 Tune SO_RCVBUF logic
- Calculate desired SO_RCVBUF by packet size for the video socket
- Use the OS default SO_RCVBUF for audio and STUN sockets
2023-07-25 18:30:19 -05:00
Cameron Gutman
da68e64d9b Fix various MSVC warnings 2021-04-29 17:21:12 -05:00
Cameron Gutman
d62ee951a0 Refactor OpenSSL usage into a platform-specific file to allow other crypto backends 2021-04-17 17:47:53 -05:00
Cameron Gutman
3fddfc5557 Fix Clang warnings 2020-12-05 23:20:02 -06:00
Cameron Gutman
5f9f7ce407 Code cleanup: use stdbool.h 2020-11-30 20:38:13 -06:00
Cameron Gutman
e74fe2b016 Fix socket errors being clobbered by closeSocket() 2020-08-28 18:48:15 -07:00
Cameron Gutman
3dd9a9f1b1 Use RAND_bytes() instead of rand() for STUN transaction IDs 2019-12-08 14:49:28 -08:00
Cameron Gutman
438b4f87d3 Rewrite STUN code to avoid requiring TCP and use multiple servers in parallel 2019-08-13 17:51:11 -07:00
Cameron Gutman
6750cde2ab Test STUN server via TCP to allow fallback if it's unreachable 2019-08-07 23:13:27 -07:00
Cameron Gutman
708a513256 Initialize platform sockets in LiFindExternalAddressIP4() 2019-02-22 20:59:54 -08:00
Cameron Gutman
dc21e28e1f Fix parsing XOR-MAPPED-ADDRESS if the optional comprehension bit is set 2019-01-22 17:35:53 -08:00
Cameron Gutman
396b02a94d Test each address returned in the getaddrinfo() call and stop blindly preferring IPv4
Fixes NAT64 on iOS 12 and probably other obscure configurations
2018-11-16 00:37:38 -08:00
Cameron Gutman
11ea2b1053 Add more distinguishable error codes for STUN 2018-10-28 17:19:40 -07:00
Cameron Gutman
0eed722635 Add a simple STUN function for resolving external WAN addresses 2018-10-26 19:20:40 -07:00