Commit Graph

30 Commits

Author SHA1 Message Date
Sean DuBois
bdb23b0bf4 Improve parsing candidates with missing Foundation
Support missing foundation candidates with additional attributes

Resolves #390
2021-12-25 22:53:35 -05:00
Sean DuBois
bc26832ad7 Support parsing candidates with missing Foundation
Not RFC 8445 compliant but are currently emitted by Google.

Resolves #390
2021-12-15 23:12:09 -05:00
Sean DuBois
e9caba4e03 Expose ErrUnknownCandidateTyp
Expose this error so pion/webrtc can handle gracefully.
rfc8839#section-5.1 specifies that a WebRTC Agent MUST
ignore any name/value pairs it doesn't understand.

Relates to pion/webrtc#1949
2021-12-15 12:18:08 -05:00
Sean DuBois
6d30128765 Revert "Remove unknown constant"
We will re-do this in the future, but need to keep it for a major
release.

Resolves #385
2021-08-11 13:09:13 -04:00
Woodrow Douglass
366757d59d Remove unknown constant
This constant tends to cause collisions with enumerations, and is
in general a source of bugs
2021-08-10 15:51:40 -04:00
Meelap Shah
1b533aee68 Populate RelayProtocol for relay candidates
The webrtc-stats spec defines this field as:
> It is the protocol used by the endpoint to communicate with the TURN
> server. This is only present for local candidates. Valid values are
> "udp", "tcp", or "tls".
https://w3.org/TR/webrtc-stats/#dom-rtcicecandidatestats-relayprotocol
2021-07-20 16:05:57 -04:00
Sean DuBois
6e4403794a Implement GetSelectedCandidatePair
Related to pion/webrtc#1713
2021-04-10 16:52:52 -07:00
Sean DuBois
e0312efe33 Fix candidateBase Marshal receiver type
Should be a pointer, not a value. Copying the atomics was causing a
race

Resolves #307
2020-11-28 21:47:14 -08:00
Sean DuBois
1a4dd6394c Log don't return error on writeTo fail
Downstream isn't able to distinguish a temporary from a Permanent
error yet.

Relates to #252
2020-11-13 04:52:57 -08:00
Pion
d3e1775d73 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-26 08:54:24 -07:00
Sean DuBois
28df93f669 Expose Priority and Foundation overrides
Allow pion/webrtc to override these as well
2020-09-12 23:40:36 -07:00
Sean DuBois
a03db7f0a3 Preserve Priority and Foundation E2E
We need these when handling remote candidates
2020-09-12 23:03:38 -07:00
Sean DuBois
f5493bc7fb Add TCPType Support
Unmarshal/Marshal now supports TCPType
2020-09-12 21:10:58 -07:00
Sean DuBois
43c86267c6 Add Foundation generation to Candidate
Also add some comments to Candidate interface
2020-09-12 21:10:58 -07:00
korymiller1489
166df5842e Add Marshal and Unmarshal to Candidate Base
Move string representation of candidates into pion/ice from pion/webrtc
2020-09-12 00:23:24 -07:00
Jerko Steiner
b828116017 Make TCP ICE candidates have lower preference
Closes #262. Adds the changes in determining local preference according
to RFC 6544, section 4.2.
2020-08-10 21:02:15 +02:00
Sean DuBois
e8ac36354c Don't unset conn in candidate_base
Instead check `closeCh` inside close. The current pattern
will cause issues if a packet is in flight.

The alternative is to add a nil check in writeTo, but that would
require locking around writes.

Resolves #247
2020-07-16 19:51:02 -07:00
Jerko Steiner
12f44e93f1 Add support for passive ICE TCP candidate
Closes #196
2020-07-15 07:51:55 +02:00
Atsushi Watanabe
2be742f5d2 Set Conn.SetDeadline on candidate close
To ensure recvLoop is unblocked after close.
Also, add double start() check to avoid
leaking recvLoop routine.
2020-07-12 14:26:42 +09:00
Atsushi Watanabe
06922c1601 Refactor agent task runner
- Control blocking tasks by context
- Add tests to check deadlock by calling Close/Restart in
  state change callback
- Remove unnecessary chan
2020-07-05 16:05:45 +09:00
Atsushi Watanabe
d64ae4c32f Pause candidate recvLoop until init
Avoid using uninitialized object on receiving packet.
2020-06-26 11:16:59 -07:00
Sean DuBois
5cab987ca4 Add an additional done to Agent.run
Callers of run need to be able to cancel their waiting individually.
This would cause hung threads during restart if we attempted to close
a candidate while processing a packet for it.

Before the run would be canceled by the global close, but we can't
depend on that anymore.

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
f1bfc8fea1 Start Agent performance refactor
Remove taskChan and make .run just take an Agent wide mutex and run the
function. These is now a blocking operation so all channels used to
communicate from it must be buffered.

After this we will slowly remove usage of .run and make things more
thread safe.

Relates to #80, #67, #2
2020-03-01 20:25:45 -08:00
Atsushi Watanabe
b8eb3d4ec4 Upgrade golangci-lint to 1.19.1
Fix whitespace error.
Disable dogsled and godox.
2020-01-11 22:58:26 -08:00
David Hamilton
11a6fedef9 Check for nil when loading atomic values
This is required to prevent an error when values are loaded
without first being set.
2019-12-12 01:20:51 +13:00
Hugo Arregui
425c6d9ef8 Improve candidate base locking mechanism
Use atomic values for lastReceived and lastSenti. The lock around
resolvedAddr and conn was not being used, so I removed it
2019-08-16 00:07:02 +00:00
Hugo Arregui
1ff70e0ee1 Initial stats
Add basic candidate and candidate pair stats
2019-06-22 11:55:06 +00:00
Sean DuBois
acbf5671b7 IP -> Address in public API
ICE RFC specifies this value as `Address` and not IP. We need to fix
this divergence to implement mDNS

Relates to pion/webrtc#699
2019-06-21 20:22:21 +08:00
Sean DuBois
2a96a308d5 Initial TURN implementation
This implementation is not fully tested, and we don't
handle all error case yet. We will continue to work on it though.

Tests for send/recv and shutdown are in the works.

Relates to #47
2019-05-27 23:30:50 -07:00
Sean DuBois
63b37975b6 Make Candidate an interface
This change will allow us to have custom logic and members
per interface type. Relay candidates will have a completely different
read loop, and candidate specific state.

Relates to #47
2019-05-24 15:55:42 -07:00