Commit graph

25 commits

Author SHA1 Message Date
Per K
6db0db5cfd Ensure TCPPort is notified of sent packets after reconnect
This fix an issue where the socket does not notify the port of sent packets after that the TCPConnection has opened a new socket. TcpConnection will open a new socket if the TCP  connection has been closed.

Bug: webrtc:361124449 b/359989715
Change-Id: Id33c5fc5292ee7d1c2d1cad6c373e2d4355d4fe1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360260
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42865}
2024-08-27 12:29:52 +00:00
Philipp Hancke
833ec4d123 Make Port constructor take a CreatePortArgs argument
Introduces a struct CreatePortArgs that is similar to the existing
CreateRelayPortArgs and contains parameters that will be passed from
the constructors of descendents of the Port class to the Port.

This struct makes it easier to add new arguments to the port
constructor without changing all inheriting classes.

Rebase of https://webrtc-review.googlesource.com/c/src/+/341021

BUG=webrtc:14626

Change-Id: Id8e5c24a36149e1699e2b42c57e52002d27c86c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42339}
2024-05-17 15:39:47 +00:00
Per K
c09cc4f961 rtc::Port use Socket::RegisterReceivedPacketCallback
Change Stun, Turn, TCP and UDP  ports to use Socket::RegisterReceivedPacketCallback and be notified of received packets using the rtc::ReceivedPacket class.


Change-Id: I7eba2ffdd83ae6f6181f765474aab7c57ff25507
Bug: webrtc:15368, webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327941
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@google.com>
Cr-Commit-Position: refs/heads/main@{#41195}
2023-11-20 13:29:09 +00:00
Tommi
cbaf91bcf0 Disconnect signals when destroying socket
Add thread checks to TcpPort code

Bug: chromium:1478154
Change-Id: I045106c552dfcd8a8ab79218a59873fdc1d4326f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318061
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40693}
2023-09-05 07:02:24 +00:00
Ali Tofigh
de2ac5a6f3 Adopt absl::string_view in p2p/
Bug: webrtc:13579
Change-Id: Ia33afa2a9ad12d1a586087d49f581a93fddb565d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262766
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37381}
2022-06-30 13:19:18 +00:00
Ali Tofigh
58ecd42deb Remove std::string version of some functions that are no longer needed.
The absl::string_view versions can now be made pure virtual due to
downstream client changes. The std::string versions in the base
classes are still needed by downstream users, but will be removed
eventually.

Bug: webrtc:13579
Change-Id: Id757a07380f0518edf407ff5d0644511eb1e53d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265980
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37349}
2022-06-28 09:06:02 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Ali Tofigh
ea5a944921 Add absl::string_view version of PortInterface::SupportsProtocol()
This is the first step of migrating SupportsProtocol() to
absl::string_view. The std::string version will be removed once all
downstream users have migrated and have implemented the
absl::string_view version.

Bug: webrtc:13579
Change-Id: Ib609b9bab0c2e525553daddb1e365050bbe1c1f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265806
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37211}
2022-06-14 15:01:12 +00:00
Tommi
c85e473740 [Connection] Remove friend clause for ConnectionRequest
* Switch to StunRequest where ConnectionRequest isn't needed.
* Move ConnectionRequest into Connection as a subclass
* Move declaration+implementation into the .cc file.

Bug: none
Change-Id: I1591a91d8e13a0db9f89cfbba0fbc9478a55b789
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264150
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37036}
2022-05-30 10:34:23 +00:00
Tommi
b44a794bd3 Remove sigslot inheritance from Connection
...and add to TCPConnection as it's still needed there.

Bug: webrtc:11943
Change-Id: Id66b890677d7e0b03a4a700414f574abd6e3af58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260320
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36689}
2022-04-28 11:40:44 +00:00
Tommi
d7e5cfb3cf Use WeakPtr<Port> in Connection classes.
This is to aid with catching issues whereby a connection object might
have a bad reference back to a port object, e.g. inside of an async
callback.

Bug: webrtc:13892
Change-Id: I56503fedc2865919713b10f236ce023554c68ded
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257164
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36394}
2022-03-31 12:44:02 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Jonas Oreland
c06fe8b04e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 11/inf
convert rtc_base/network and collateral.

This also remove last usage of system_wrappers/field_trials
in p2p/...Yay!

Bug: webrtc:10335
Change-Id: Ie8507b1f52bf7f3067e9b4bf8c81a825e4644fda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36357}
2022-03-28 15:48:01 +00:00
Niels Möller
e0c6bdf071 Use const rtc::Network* in ports and port allocator
No-try: True
Bug: webrtc:13869
Change-Id: I6004fa96278263d0d25a1446d7bb8de41a563433
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256682
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@google.com>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36353}
2022-03-28 12:48:30 +00:00
Mirko Bonadei
0cb1cfa69e Reland "Removing MessageHandler dependency from Connection."
This reverts commit 05ea12e513.

Reason for revert: Speculative revert.

Original change's description:
> Revert "Removing MessageHandler dependency from Connection."
>
> This reverts commit 3202e29f72.
>
> Reason for revert: Introduced a crash in the task posted by Destroy()
>
> Original change's description:
> > Removing MessageHandler dependency from Connection.
> >
> > Bug: webrtc:11988
> > Change-Id: Ic35bb5baeafbda7210012dceb0d6d5f5b3eb95c9
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249941
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35890}
>
> No-Try: True
> Bug: webrtc:11988
> Change-Id: Ie70ee145fde75b8cf76b02784176970e7a78e001
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252541
> Auto-Submit: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36078}

No-Try: True
Bug: webrtc:11988
Change-Id: Idfd42d016e81d4352839c33dcb4ea3b0dafea08b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252584
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36081}
2022-02-25 11:01:54 +00:00
Taylor Brandstetter
05ea12e513 Revert "Removing MessageHandler dependency from Connection."
This reverts commit 3202e29f72.

Reason for revert: Introduced a crash in the task posted by Destroy()

Original change's description:
> Removing MessageHandler dependency from Connection.
>
> Bug: webrtc:11988
> Change-Id: Ic35bb5baeafbda7210012dceb0d6d5f5b3eb95c9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249941
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35890}

No-Try: True
Bug: webrtc:11988
Change-Id: Ie70ee145fde75b8cf76b02784176970e7a78e001
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252541
Auto-Submit: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36078}
2022-02-25 10:41:13 +00:00
Tommi
3202e29f72 Removing MessageHandler dependency from Connection.
Bug: webrtc:11988
Change-Id: Ic35bb5baeafbda7210012dceb0d6d5f5b3eb95c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249941
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35890}
2022-02-02 16:32:20 +00:00
Niels Möller
646fddc3c9 Fix TCPPort::SetOption to apply options to the accepted sockets
The AsyncListenSocket::SetOption method then gets unused, and can be
deleted.

Bug: webrtc:13065
Change-Id: Idcf70a75b96036290fdceff6e0f96a8d5617f87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236580
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35302}
2021-11-03 11:02:46 +00:00
Niels Möller
6d19d14c26 Add AsyncListenSocket, as alias for AsyncPacketSocket
A preparation for splitting server sockets out into a separate
interface, see https://webrtc-review.googlesource.com/c/src/+/232607.

Transition plan:

1. Land this cl.

2. Update downstream code to use the new name.

3. Attempt landing
   https://webrtc-review.googlesource.com/c/src/+/232607. May need
   additional steps to not break downstream implementations of
   PacketSocketFactory::CreateServerTcpSocket.

Bug: webrtc:13065
Change-Id: Ife448c705222f4c9f66a096e3dc7eb07e0f9c3af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233700
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35155}
2021-10-06 11:42:50 +00:00
Niels Möller
4a1c2c4754 Delete wiring of SignalAddressReady for TCP ports
This feature is used only by chromium, and only for UDP sockets.

Bug: webrtc:13065
Change-Id: I207ea643aa57cf23bdd36266895f65f1ee251aaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35106}
2021-09-28 10:05:05 +00:00
Jonas Oreland
7a284e1614 TCPConnection: Defer FailAndPrune by signaling to self
What steps will reproduce the problem?
1. Connect a TCPPort, creating a TCPConnection
2. Disconnect the interface (e.g turn it off in android)
3. Send Ping on the TCPConnection

Crash.
The TCPConnection calls FailAndPrune when it fails to reconnect
the TCPConnection. FailAndPrune which removes the StunRequests.
When this is called from the Ping() code,
that will still access the StunRequest after the call to the Connection.

Solution: Instead of calling FailAndPrune deep down in the Ping()-stack
post a message to self to do this with a "clean" stack instead.

BUG: webrtc:11315
Change-Id: Id328b1b7c92311fa5b9adbfd2eb1dd14bf19805d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167522
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30389}
2020-01-28 09:50:06 +00:00
Jonas Oreland
e8e7d7b0bc Move Connection into it's own .h/.cc file.
This patch is a NOP and moves
- class Connection
- class ConnectionInfo
- class ProxyConnection

from port.{h/cc} to a new file called connection.{h/cc}

BUG=webrtc:10647

Change-Id: I89322d3421d272657e24a46b28ab6679fcdc9450
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137509
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28101}
2019-05-29 11:27:47 +00:00
Mirko Bonadei
bfc9911661 Remove TCPPort incoming_only_ member.
TCPPort's incoming_only_ member seems unused and there was a TODO
about this. This CL just removes it.

Bug: webrtc:10198
Change-Id: I216c291159a32fa2924309affa3769a4be116fd0
Reviewed-on: https://webrtc-review.googlesource.com/c/120931
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26538}
2019-02-04 19:46:30 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Renamed from p2p/base/tcpport.h (Browse further)