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.
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.
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
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.
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.
Simplify GatherInterfaces
Store the interface vector indirectly. This makes is so that we don't
have to define the move constructors/assignment, needed so that we can
remove items from the list. Also, looking ahead, I want the callbacks
to have a pointer to their interface, which will remove a little bit
of lookup work, and this will require stable pointers.