Commit Graph

39 Commits

Author SHA1 Message Date
Sean DuBois
7c2352003b Update pion/srtp and pion/transport
Removes context usage
2020-12-02 20:20:03 -08:00
Sean DuBois
9715626a0c Revert "Read/Write RTP/RTCP packets with context"
This change caused a ~24% performance decrease

Relates to pion/webrtc#1564

This reverts commit 47a7a64898.
2020-12-02 20:11:06 -08:00
Atsushi Watanabe
47a7a64898 Read/Write RTP/RTCP packets with context
Control cancel/timeout by context.
2020-12-01 11:08:48 +09:00
Sean DuBois
e32d766199 Improve TrackLocal error handling
* Return error to user when remote doesn't support codecs
* Assert that bindings are properly incremented/decremented
* Assert that a added track doesn't error even when disconnected

Relates to #1526
2020-11-27 23:07:29 -08:00
Sean DuBois
804a12fed3 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-30 09:06:34 -07:00
mission-liao
0786371c1e Keep sessions in atomic.Value
This modification attempts to fix a deadlock happens when closing a
peer-connection.

The deadlock scenario is:
- routine-1: DTLSTransport.Stop is called during closing, which holds
  the writer-lock of DTLSTransport, and it blocked by accepting from
  session.closed channel when trying to close SRTPSession.
- routine-2: its stacks located in the routine launched in
  srtp.session.start(...), this routine should close the session.closed
  channel, however, it blocked when sending to
  srtp.SessionSRTP.session.newStream
- routine-3: this routine should call strp.SessionSRTP.AcceptStream
  to release routine-2. However, it blocked when calling
  DTLSTransport.getSRTPSession(), it requires the reader-lock.

To resolve this issue, the instance of SessionSRTP is kept in
atomic.Value and avoid the requirement of reader-lock in
DTLSTransport.

Fixes #1430
2020-09-27 22:23:09 -07:00
soolaugust
6f6de25b24 Modify all hdlr to handler for better reading
change hdlr -> handler, Hdlr -> Handler for better reading.
Since this is first commit, add myself to contributors
2020-08-17 22:04:29 -07:00
Renovate Bot
ca3cc9d940 Update module pion/srtp to v1.5.0
Generated by renovateBot
2020-07-20 23:00:53 -07:00
Sean DuBois
89d7de1787 Start /v3
See #9 for the features we have planned, and the breaking changes that
may occur.
2020-06-25 09:45:27 -07:00
John Berthels
cc8d80178c Set role when actpass remote to DTLSRoleClient
This matches rfc5763, setup:active is RECOMMENDED

Relates to #494
2020-06-16 00:25:05 -07:00
Sean DuBois
32070dc053 Remove TODO for #753
I have resolved this issue, we don't need to support both ECDSA/RSA at
the same time. Most users will only ever do ECDSA anyway.
2020-04-26 01:03:16 -07:00
Atsushi Watanabe
4220088d78 Follow pion/dtls API change
Use ConnectionState().
2020-04-11 16:27:06 +09:00
Simon Eisenmann
b95ee52c41 Add helpers to disable replay protection
Sometimes the replay protection of SRTP and SRTCP needs to be disabled.
This change adds disableSRTPReplayProtection and
DisableSRTCPReplayProtection helpers to SettingEngine.
2020-04-06 08:37:16 +02:00
Atsushi Watanabe
438ac1eb2f Add replay protection setting to SettingEngine
Set windows size of each protocol by:
- SetDTLSReplayProtectionWindow
- SetSRTPReplayProtectionWindow
- SetSRTCPReplayProtectionWindow
2020-03-29 12:22:55 -07:00
Atsushi Watanabe
b457163d6d Discard double close error of dtls conn
sctp.Stream.Close() closes inner dtls connection.
2020-03-24 19:14:25 +09:00
Atsushi Watanabe
e7e1cf5a74 Upgrade pion/dtls to v2.0.0-rc.6
Follow dtls module API and module path update.
2020-02-17 09:01:33 +09:00
Sean DuBois
d10941f2a4 Add SettingEngine entries needed for offline sync
Allow users to set statice ICECredentials and to disable
DTLS Certificate Verification
2019-12-09 16:43:44 -08:00
Sean DuBois
7c216c2172 Bump DTLS
DTLS API has been updated to support multiple certificates. No
behavior changes for `pion/webrtc`
2019-11-27 00:34:50 -08:00
Sean DuBois
9eb515af7c Use pion/dtls v2
API now allows multiple certificates, there is no behavior change
this is just to bring things more inline with crypto/tls
2019-11-24 23:29:20 -08:00
Sean DuBois
36b02632d1 Match W3C when closing
PeerConnection.Close() doesn't match the W3C RFC on closing,
re-order the transports so that they close in the proper order.

In the future we will use the DTLS Close alert and RTCP Bye to
better communicate shutdown
2019-11-21 11:55:48 -08:00
Sean DuBois
7584762124 Expose Answering DTLSRole via SettingEngine
User can now control what DTLSRole the local client
takes when answering via the SettingEngine.

Relates to #880
2019-10-22 01:11:21 -07:00
Vicken Simonian
5f25df2209 Various spell fixes
For error types, vars, docs and comments
2019-10-17 23:31:21 -07:00
Sean DuBois
3f2c36d153 Add PeerConnectionState
Start properly setting the PeerConnectionState and make
OnConnectionState available

Resolves #614
2019-09-15 21:01:47 -07:00
Sean DuBois
8dfbafbcdd Update TODOs around multiple certificates
We are blocked by pion/dtls not support multiple certificates.
I have created an issue in GitHub issues for WebRTC and DTLS

Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
cea1c74e0e Bump pion/dtls
pion/dtls verifies certificates by default now. Disable verification
since WebRTC uses self-signed

Relates to pion/dtls#81
2019-07-26 01:40:45 -07:00
Sean DuBois
10d2ca3d88 Enable gochecknoglobals linter
Resolves #434
2019-07-09 23:31:56 +01:00
Sean DuBois
eb737ba0b2 Fix routine leak in drainSRTP
Store orphaned SRTP/SRTCP streams and discard them
when we close the PeerConnection

Resolves #729
2019-07-06 22:58:07 +01:00
Sean DuBois
213f495a75 Implement DTLSTransport state
Add OnStateChange and State for DTLSTransport

Relates to #729
2019-07-06 22:58:07 +01:00
Adam Kiss
736e0bb506 Remove usage of ICETransport unexported fields
There are some direct usages of unexported fields of ICETransport
from non ice-related methods. This would be problematic when ice
once ice related code is moved to a separate packet. Added proxy
methods to ICETransport to avoid this.
2019-05-09 19:52:51 +02:00
Sean DuBois
dbde6114a2 Update import paths
Add /v2 to import paths everywhere
2019-04-07 02:17:15 -07:00
Sean DuBois
620bd36687 Pass LoggerFactory to DTLS and SRTP
Resolves #361
2019-04-06 19:57:34 -07:00
Sean DuBois
4c781e64d9 Return error on certificate fingerprint failure
Instead of printing the error to stdout return the error to the user.
This may not be a hard error (as later certificates would have passed)
but it never is good to be in a state where you have certificates in a
broken state.

Resolves #586
2019-04-05 00:48:22 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Sean DuBois
776c551307 Don't notify users via Track of ICE errors
Writing to a Track shouldn't return errors for an individual
RTPSender. This filters ErrNoCandidatePairs from being returned
and instead just returns nil

Resolves #523
2019-03-29 17:16:35 -07:00
Alex Browne
0f1ddf0825 Add JavaScript/WASM bindings
Resolves #478. Adds minimal JavaScript/WASM bindings. This makes it
possible to compile core parts of pions/webrtc to WASM and run it in the
browser. Only data channels are supported for now and there is
limited/no support for certificates and credentials.
2019-03-08 00:26:17 +01:00
Sean DuBois
43604d5491 Remove pkg/errors dependency
Lots of people are paying attention to what dependecies we add to their
projects now. This just makes things a little cleaner.

Resolves #469
2019-03-06 09:34:10 -08:00
Michael MacDonald
b8f3e36b00 Add OnSelectedCandidatePairChange callback
Invoked when the selected ICE candidate pair changes.
2019-03-01 08:07:42 -05:00
Sean DuBois
632b16b852 Update golangci-lint to v14.0.0
Update linter to newest version and fix all new issues
2019-02-17 21:35:04 -08:00
Max Hawkins
0647ce9c26 Remove rtc prefix from filenames
Relates to #408
2019-02-17 16:22:56 -08:00