Sometimes the RFC algorithm wants you to immediately 'retrigger' a
candidate check. The previous code was deleting the previous request
and creating a new one. But this means that any reply that comes in
cannot get matched up, because the new request will get a new
transaction ID. In general, I think any time we cancel a request and
throw it away, it is probably a mistake, because the reply that comes
back contains useful information, and if we throw away the request, we
won't be able to match it up by transaction ID and remember what we were
doing, so we lose that information.
This can be catastrophic. The Mac CI was failing because of a timing
issue where each side would 'retrigger' its request just before the
reply to the previous request arrived. All of the responses were
getting dropped because they could not be matched up by transaction ID.
The new code just resets the retransmission timer, causing us to send it
immediately and also resets the exponential backoff schedule.
Also, simplify some logic and tweak formatting.
(cherry picked from commit f539edb097)
It needs the local candidate (with the relay, if present), not just the
interface. And check for either candidate being relayed, then route is
relayed.
(cherry picked from commit 6776f82e78)
This helps make sure that relayed routes don't win a race, and we
can use the naive RFC algorithm and confirm that we get the route
type that we expect
(cherry picked from commit 53b6ca0a22)
Add ICELocalCandidate. This was deleted earlier, because it had a bunch
of extra stuff that we don't care about when comparing if two local
candidates are the same. Essentially if we send diretcly from our
socket, then we don't really care what kind of candidate it is to the
peer. But we do really need to distinguish between local candidates
that are relayed.
Add ICESessionInterface::SendPacketGather, which knows how to wrap a
data packet in a k_nTURN_SendIndication
Check for k_nTURN_DataIndication from TURN servers. This doesn't work
fully right now.
(cherry picked from commit 19be4d372a)
Really, the separation between CSteamNetworkingICESession and
CConnectionTransportP2PICE_Valve is just not very useful and
those classes should be merged.
(cherry picked from commit 9aed2eb8c2)
- Move 'factory' functions to be methods on ICESessionInterface
- Delete CRecvSTUNPktCallback, callback can be just a simple pointer to
method
- Serialize the request once instead of saving off attributes and
complicated memorty management.
(cherry picked from commit e09fbc9616)
vcpkg manigest:
- Add vcpkg-cmake as dependency of this project
- Don't support bcrypt as vcpkg feature. Nobody using vcpkg wants bcrypt,
so this is just a trap.
Local/test overlay port:
- Fix how we are setting SOURCE_PATH
- Add symlink to out vcpkg.json manifest, since a port needs one
Chat example built using vcpkg:
- Add GNS_LINK_STATIC option to vcpkg_example_chat project so I can test
an app linking against static or dynamic lib.
Sometimes the RFC algorithm wants you to immediately 'retrigger' a
candidate check. The previous code was deleting the previous request
and creating a new one. But this means that any reply that comes in
cannot get matched up, because the new request will get a new
transaction ID. In general, I think any time we cancel a request and
throw it away, it is probably a mistake, because the reply that comes
back contains useful information, and if we throw away the request, we
won't be able to match it up by transaction ID and remember what we were
doing, so we lose that information.
This can be catastrophic. The Mac CI was failing because of a timing
issue where each side would 'retrigger' its request just before the
reply to the previous request arrived. All of the responses were
getting dropped because they could not be matched up by transaction ID.
The new code just resets the retransmission timer, causing us to send it
immediately and also resets the exponential backoff schedule.
Also, simplify some logic and tweak formatting.
It needs the local candidate (with the relay, if present), not just the
interface. And check for either candidate being relayed, then route is
relayed.
This helps make sure that relayed routes don't win a race, and we
can use the naive RFC algorithm and confirm that we get the route
type that we expect
Add ICELocalCandidate. This was deleted earlier, because it had a bunch
of extra stuff that we don't care about when comparing if two local
candidates are the same. Essentially if we send diretcly from our
socket, then we don't really care what kind of candidate it is to the
peer. But we do really need to distinguish between local candidates
that are relayed.
Add ICESessionInterface::SendPacketGather, which knows how to wrap a
data packet in a k_nTURN_SendIndication
Check for k_nTURN_DataIndication from TURN servers. This doesn't work
fully right now.
Really, the separation between CSteamNetworkingICESession and
CConnectionTransportP2PICE_Valve is just not very useful and
those classes should be merged.
- Move 'factory' functions to be methods on ICESessionInterface
- Delete CRecvSTUNPktCallback, callback can be just a simple pointer to
method
- Serialize the request once instead of saving off attributes and
complicated memorty management.
Delete UpdateHostCandidates, just create the host candidate immediately
when we create the interface.
Also delete ICECandidateBase::CalcPriority. We only called that when
adding a new local candidate, so just do the work directly in the
constructor.
(cherry picked from commit 6f6419084e)
Not the local candidate! A "local candidate" is a thing that we need to
tell our peer about, but when we need to send or receive packets, we
use a socket. When a socket has a host candidate, a server reflexive
candidate, etc, we don't really know or care which of those candidates
the peer used to talk to us.
Also, deleted IsCandidatePermitted. We need this, but the place we were
calling it was wrong.
(cherry picked from commit e735bc0329)
Delete UnpackSTUNHeader and IsValidSTUNHeader. Combine them and
expand them inline at the only place we need to do this.
Rename DecodeSTUNPacket to ParseSTUNAttributes. It will get a copy
of the header already parsed, and will assume that the packet has
already been verified to be STUN.
Rename CSteamNetworkingSocketsSTUNRequest::OnPacketReceived to
ReplyPacketReceived and pass in what we have already parsed.
Delete return value, which was unused by only call site also
referred to silly nonsensical constants
(cherry picked from commit fd500ef8ba)
Socket callback will be the interface pointer, which gives us
a little bit more context and makes a few things simpler.
(cherry picked from commit 60314c1606)
This removes several places where we need to lookup the interface.
But since we are storing a pointer, it means now we need to make sure
and carefully cleanup if an interface drops out of the interface list.
(cherry picked from commit 3d29fc0a08)
There was a nested type CSteamNetworkingICESession::ICECandidateType,
which was named very confusingly similar to EICECandidateType. That
type uses different enum values based on the address family.
Renamed it to ICECandidateKind, made it an enum class, and promoted
to global scope.
Also, moved RFC5245CandidateAttr so we don't have to forward declare
it.
(cherry picked from commit 9032a75a17)