This patch is a follow up to https://webrtc-review.googlesource.com/c/src/+/260943
which made it possible to destroy a Port before a Connection (on that
port).
This patch "reverses" this, by adding RTC_DHECK, and fixes the Port
destructor to release the Connections before invalidating the WeakPtr<>.
Currently there are no known occurrences where a Connection is destroyed after it's Port is. But prior to the change in Port destructor, a bunch unit tests failed on the newly added DCHECKs.
In addition:
a) modify StunReqquestManager to remove entry from hash before calling callback. This makes it possible for callback to modify (clear) hash.
b) clear pending requests when disconnecting from port, "should not be needed", depends on a)
c) add a getter for pending_delete()
Bug: webrtc:13892, webrtc:13865
Change-Id: I5d18f2db8d93b7cc25d18bd620063589ee9257c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322861
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40907}
This removes internal usage of AsyncResolver, including from
PhysicalSocketServer.
PhysicalSocketServer was also run through IWYU.
Bug: webrtc:12598
Change-Id: I18aa6fb60e4a40face4afa0446a161379470680d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322721
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40900}
There's no trace of it being in use, so let's remove it.
Bug: webrtc:12497
Change-Id: I9e81ef58b459b5a0b9f79b6638231a3a19eb8a0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322180
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40855}
Remove internal use of SignalSSLHandshakeError and prepare removal of
sigslot dependency from SSLStreamAdapter.
Bug: webrtc:11943
Change-Id: I9768e2e31529945620bdd8d0d285042bb2388b7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318881
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40695}
This constructor isn't used in production. Removing it further
made the construction state of the class simpler, allowed for removal
of the separate Init() method and making more members const.
Bug: none
Change-Id: Ibc8516a01ce7e385207251d841d21bb7b72c9d9a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318281
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40678}
This time, hit the BUILD files too (where possible).
Bug: webrtc:11943
Change-Id: Ic8f2d77e1ba66f740efe0ef73b1ea6051356dedc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318100
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40654}
Also change return type for username_fragment() to be const& and not
create a copy.
Bug: none
Change-Id: I8591af3da54fc8a9784e13cb000c4e02c0cd2f40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317980
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40651}
while this is already logged when actually switching, knowing
why connections get sorted and evaluated may be useful.
BUG=None
Change-Id: I1449b0e1fb3624c04d7fb2730a05ffa7c7d1f37a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/313100
Reviewed-by: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40521}
This patch hooks up the StunDictionary to Connection
and P2PTransportChannel.
Bug: webrtc:15392
Change-Id: Ibeea4d8706ebd42f2353d9d300631c02bf0d484d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315100
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40519}
This patch adds a StunDictionary.
The dictionary has a reader and a writer.
A writer can update a reader by creating a delta.
The delta is applied by the reader, and the ack is applied by the
writer.
Using this mechanism, two ice agents can (in the future) communicate
properties w/o manually needing to add new code.
The delta and delta-ack attributes has been allocated at IANA.
Bug: webrtc:15392
Change-Id: Icdbaf157004258b26ffa0c1f922e083b1ed23899
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314901
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40513}
This is a reland of commit 86cfe50c0e
The fix was to add a backwards compatible #include + build dep.
They will be removed once Chromium is migrated.
Original change's description:
> Extract HasIPv4Enabled/HasIPv6Enabled.
>
> Bug: b/292167110
> Change-Id: Idafa4ef23e87951bdd0276c29dee3e7f8be68476
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/312580
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40478}
Bug: b/292167110
Change-Id: I9797f52adf15aba57e114d0a1efec0f757ead278
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/313264
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40491}
Introduces a field trial
WebRTC-IncreaseIceCandidatePriorityHostSrflx
that adjusts the priority of non-relay candidates such that the STUN priority attribute calculated as
(prflx-type-preference << 24) | (priority & 0x00FFFFFF)
as described in
https://www.rfc-editor.org/rfc/rfc5245#section-7.1.2.1
will satisfy the condition that the STUN priority of server-reflexive candidates will always be higher than the STUN priority of relay candidates.
Previously this was not the case because the TURN relay preference was added to the local_preference for relay candidates, making it higher than the local_preference of srflx candidates gathered from the same interface.
This led to cases where the resulting candidate pair priority of a srflx-relay pair was higher than the candidate pair priority of a srflx-srflx pair, i.e. using a TURN server in cases that work using a direct P2P connection.
Whether the field trial is active can be observed by checking that
priority-of-srflx-candidate&0x00FFFFFF
is greater than
priority-of-relay-candidate&0x00FFFFFF
BUG=webrtc:13195,webrtc:5813,webrtc:15020
Change-Id: Ib91708fbe7310b6454f93158a45c9d77da009091
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292700
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40311}
The fixes have been default enabled, so clean up dead code.
Bug: webrtc:14334
Change-Id: I4967d5ad451ac333c54294fc14bea6c7ba1445e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301180
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39949}
which only had a single member after the removal of
GICE around M42. The last downstream usage in Chromoting
was removed in
https://chromium-review.googlesource.com/c/chromium/src/+/4385113
BUG=webrtc:4299
Change-Id: Id444967822cd19b0e514ba70739a8d45a7f78fae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299600
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39945}
Fully launched on mobile and approved for chrome launch.
Removed tests for feature enablement with field trial.
Bug: webrtc:14334
Change-Id: I7ca7183ff618835fef8c820cfd52863e1c7fa25e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301163
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39879}
This was found to be uninitialized by an internal MSAN bot.
Bug: b/276318905
Change-Id: I0f0742113b6a5eba10ec6f51072510c91bf5676b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301401
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39871}
connections() just wraps over the member connections container after the ICE controller refactor cleanup. So remove the indirection.
Bug: webrtc:14367
Change-Id: Ie2dc13bce5fc440cf1e2f0d20499da9adeca8e35
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294341
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39406}
Parameterization was used to inject field trial for using the active ICE controller. The field trial is not used any more after fully launching the refactor. This simplifies as well as reduces the number of tests.
Bug: webrtc:14367
Change-Id: I48dfb2fc5cc4f1278f203a0b2ebb2131cae64690
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294320
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39402}
Refactor is fully launched on mobile and approved for full launch on chromium.
Bug: webrtc:14367, chromium:1368516
Change-Id: I536f2630887eb187e8f9397ba033dbb65f4acad8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294281
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39388}
Also added an enum for unknown reason.
New value uses a macro-like name rather than a constant-like name for consistency.
Bug: chromium:1369096, webrtc:14131
Change-Id: Ib315584ec40d8c1cd9a6f0ff44587c0d92c735d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292341
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39262}
Breaking this dependency is required for using FakePortAllocator in chromium tests to make the windows component build work.
Bug: chromium:1408420
Change-Id: I4215b92c1d1430156107605e5b054926b30f83f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291114
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39180}
This should help to debug problems with DNS resolution of turn server
name. E.g. DNS server returns fake IP address to block turn server.
Similar change to stun_port.cc were done in
https://webrtc-review.googlesource.com/c/src/+/215926
Bug: None
Change-Id: If1cc410f4cd0f89620d3678aabf05a0f1b22a393
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290992
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
Cr-Commit-Position: refs/heads/main@{#39152}
This cl/ clean up the handling of message integrity in Connection.
- Port validates message integrity of REQUESTs,
using local candidate password.
- Connection validates message integrity of RESPONSEs,
using remote candidate password.
Bug: webrtc:14578
Change-Id: I6fdb638b52f4fb7a997fd50393f9ed284543beac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290700
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39028}
The STUN message about mismatched passwords is not interesting.
Only emit it in VERBOSE mode when DCHECK is on.
Bug: webrtc:14578
Change-Id: Ie83080d88be6da24e7f2f79d7eb279087f84c2a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288740
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38938}
showing whether the DTLS transport is active and will send
a client hello or not.
BUG=None
Change-Id: If5c631c5e8701b0d1a4bb484467c93027b994ed7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287863
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38886}
Add an override to TurnPort for SendBindingErrorResponse to check
if a matching connection object exists before continuing. This is
needed to match with the check in `TurnPort::DispatchPacket` whereby
we forward calls to `Port` when no matching connections exist.
Bug: chromium:1395625
Change-Id: Idf1f898c2a93de6bc2832268db1cadd52cae23a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287223
Reviewed-by: Sameer Vijaykar <samvi@google.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38871}
Already implemented for STUN hostname resolution, but TURN port resolves hostnames separately. Reusing the field trial key reserved in bugs.webrtc.org/14334 but with a new parameter so as to not affect ongoing rollouts.
Bug: webrtc:14319, webrtc:14131
Change-Id: Idf771fb2f0de7849f8b701be8ee05a98b8d242f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285981
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#38811}
Updates the code to use the new interfaces
Bug: webrtc:14632
Change-Id: I33b2a25b5968de0251e3cbc84076afc013ecef6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282680
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38601}
This is a reland of commit b395f5bd5c
Downstream project has been fixed.
Original change's description:
> move relay server priority assignment to port_allocator
>
> which knows more about the internals of ICE.
> Remove the relay server config priority field which was used to
> specify the relative priority of TURN servers. This is now handled
> internally by CreateRelayPortArgs without being exposed.
>
> Also rename BasicPortAllocator::AddTurnServer to
> BasicPortAllocator::AddTurnServerForTesting since it is a test-only
> method.
>
> BUG=webrtc:13195,webrtc:14539
>
> Change-Id: Id36cbf0187b7a84d1a9b53860f31994f3c7589f0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280224
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38520}
Bug: webrtc:13195,webrtc:14539
Change-Id: I617b611de97e4013c7286e3345073ca7589065c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281662
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38543}