Commit graph

53 commits

Author SHA1 Message Date
Jim Gustafson
49c96f3e79 Merge remote-tracking branch 'google/branch-heads/6478' 2024-06-21 16:31:45 -07:00
Jim Gustafson
c43adafcd5 Merge m123/6312 2024-06-12 22:25:35 -07:00
Per K
58cccc62cc Cleanup expired experiment WebRTC-SCM-Timestamp
Bug: webrtc:5773
Change-Id: I4950c70865c7f458324d11b74dd1043e93bc10f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347882
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42145}
2024-04-23 08:25:03 +00:00
Byoungchan Lee
d86c0cdbde Extend use of poll() to Apple systems in addition to Linux and Fuchsia
To address the limitations of select(), poll() is now used for Apple
(MacOS and iOS) systems in the PhysicalSocketServer.

Bug: webrtc:15421, webrtc:15908
Change-Id: Ic6703a08653ca608a714ea37ecbbfeaf29743c1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316480
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#42075}
2024-04-16 03:56:36 +00:00
Rashad Sookram
84db3b7d55
Log more info when select fails 2024-03-26 10:22:34 -04:00
Tim Na
4473d75651 Add TCP keep-alive options to rtc::Socket
Enabling Socket options on keep-alive related function that may enable clients to detect any stale connection early on.

Bug: webrtc:15866
Change-Id: Ib4f15e0c933aeb6cf4fd18ff8cc708d118ea8645
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342223
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tim Na <natim@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41888}
2024-03-13 04:36:58 +00:00
Per K
8df31c915a Propagate ECN information on posix sockets to rtc::ReceivedPacket
Two new socket options are introduced OPT_SEND_ECN used for setting ECN bits. OPT_RECV_ECN used for reading the ECN bits.

If ECN bits are set on received IP packets,  ECT(1) and CE is propagated via rtc::ReceivedPacket.

Bug: webrtc:15368
Change-Id: I3ac335007e2f7d30564569bbc80ce47fa541bef1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/332380
Reviewed-by: Jonas Oreland <jonaso@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41885}
2024-03-12 11:12:56 +00:00
Per K
056782c4b5 Implement Socket::RecvFrom(ReceiveBuffer& buffer) in PhysicalSocketServer
And RTC_CHECK(NOTREACHED) Socket::RecvFrom(void* pv..)

This cl also change usage of PhysicalSocket to use PhysicalSocket::RecvFrom(ReceivedBuffer&) in Nat and tests.
Note that Socket::RecvFrom(ReceiveBuffer& buffer) is already used in AsyncUdpSocket.( https://webrtc-review.googlesource.com/c/src/+/332200)
AsyncTCPSocket uses Socket::Recv(). Therefore, there should be no production usage left of Socket::RecvFrom(void* pv..) in open source webrtc.

Follow up cls should remove usage of Socket::RecvFrom(void* pv..) in implementations of rtc:AsyncSocketAdapter such as FirewallSocketAdapter.

Change-Id: I597dc32b14be98e954a3dc419723f043e8a7e19e

Bug: webrtc:15368
Change-Id: I597dc32b14be98e954a3dc419723f043e8a7e19e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/332341
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41635}
2024-01-30 16:15:04 +00:00
Jim Gustafson
3d44a9e3b5 Merge branch m120 2024-01-17 12:11:58 -08:00
Harald Alvestrand
60362c144c Prepare to deprecate AsyncResolver class
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}
2023-10-10 12:16:33 +00:00
inaqui-signal
c570368abc Merge branch 'm116' into 5845 2023-08-09 14:40:20 -05:00
Per K
7efd372f02 Per default endable reading incoming packet timestamp from socket
This cl per default enable the experiment WebRTC-SCM-Timestamp but
leaves the wiring in place for now to explictly allow disabling it.

Bug: webrtc:5773, webrtc:14066
Change-Id: I6118eef73384791ab4d1377e35d36435dc4fa0e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298442
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39624}
2023-03-21 14:41:37 +00:00
Taylor Brandstetter
5136600626 Implement WaitPoll for Fuchsia
Fuchsia's libc provides `select` and `poll` but not `epoll`.

This CL adds a `WaitPoll` method, which is modeled after `WaitSelect` but uses `poll`. The pre-existing `WaitPoll` method was renamed to `WaitPollOneDispatcher`.

TESTED="2p video call on Fuchsia. WaitPoll is faster compared to
WaitSelect, primarily because WaitSelect pessimistically calls
getsockopt(SO_ERROR) on each fd, while WaitPoll does so only on fds that
have entered an error state."

Original author: tombergan@google.com

Bug: None
Change-Id: I83cc824fca40d691fd93712c1c933ff21b3f877c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296826
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39564}
2023-03-15 14:35:08 +00:00
Rashad Sookram
03ddb5df82 Merge branch 'm110' into 5481 2023-02-17 11:35:29 -05:00
Jim Gustafson
67b9dd5a62 Cleanup merge differences from upstream
Co-authored-by: Rashad Sookram <rashad@signal.org>
2023-01-25 17:17:55 -08:00
Rashad Sookram
a08d327650 Fix logging level 2023-01-02 17:17:14 -05:00
Rashad Sookram
4344449a11 Fix compile-time error on Windows 2022-11-22 15:06:13 -05:00
Rashad Sookram
bd151651d3 Merge in M108 2022-11-11 17:02:35 -05:00
Per Kjellander
fdcfefa708 Add experiment to use ::recvmsg to receive packets on posix systems
Using ::recvmsg ensure packet timestamp can then be read directly when reading the buffer
instead of a separate system call and should also work on Ios/Mac.

The same experiment field trial flag will be "WebRTC-SCM-Timestamp/enabled/" and is also planned to be used for fixing webrtc:14066

Bug: webrtc:5773, webrtc:14066
Change-Id: I8a3749e87c686aa18fcee947472c1b602a0f63c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279280
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38585}
2022-11-08 12:51:49 +00:00
Markus Handell
9a21c49337 SocketServer: Migrate Wait/kForever to TimeDelta.
Bug: webrtc:13756
Change-Id: Ie36ca38b1ab336742231b101ef7bb5ccf3735659
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272102
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37903}
2022-08-25 13:01:34 +00:00
Jim Gustafson
3209a47bf5 Convert more socket errors/warnings to info level 2022-04-15 18:21:35 -07:00
Peter Thatcher
4a2e0e5d45
Update to 4896 (M100) (#72) 2022-04-15 17:13:23 -06:00
Jim Gustafson
9fa95682c0
Convert more socket errors/warnings to info level 2022-04-05 12:06:33 -07:00
Jim Gustafson
ad8014f0fd
Convert common error and warning logs to info severity 2022-03-15 18:34:43 -07:00
Harald Alvestrand
ef5b21e637 Deprecate and remove usage for WARNING log level
Bug: webrtc:13362
Change-Id: Ida112158e4ac5f667e533a0ebfedb400c84df4d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239124
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35425}
2021-11-27 22:21:54 +00:00
Harald Alvestrand
5f34130f26 Declare LERROR deprecated and remove all usage in webrtc
Bug: webrtc:13362
Change-Id: I1c6c6eccd950d73be616b34f96db7832ff94377e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238804
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35416}
2021-11-24 14:34:24 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Taylor Brandstetter
3041eb21e9 Improve epoll error handling.
The main change is to remove sockets from epoll if there are no
requested events, which happens when a socket is considered closed
(due to an error or otherwise). This prevents a busy loop when a socket
is an error condition where it will constantly be signaled, but not
deleted by higher level code.

Other related changes:
* Set DE_CLOSE on errors regardless of whether the socket is readable or
  writable.
* Don't set DE_ACCEPT on errors.
* Handle getsockopt(SO_ERROR) errors.
* In IsDescriptorClosed:
  * Retry recv on EINTR.
  * Treat ECONNABORTED and EPIPE as errors.

Original patch contributed by andrey.semashev@gmail.com.

Bug: webrtc:11124
Change-Id: I67f33213efc1418b1ffc8f4867f606b7f8dc4ece
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235863
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35300}
2021-11-02 21:27:03 +00:00
Niels Möller
d0b8879770 Delete AsyncSocket class, merge into Socket class
Bug: webrtc:13065
Change-Id: I13afee2386ea9c4de0e4fa95133f0c4d3ec826e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227031
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34787}
2021-08-17 15:39:25 +00:00
Artem Titov
96e3b991da Use backticks not vertical bars to denote variables in comments for /rtc_base
Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
2021-07-28 13:51:47 +00:00
Niels Möller
21347458ad Simplify PhysicalSocketServer
Merge OnPreEvent and OnEvent methods.
Merge EventDispatcher class into Signaler class.

Bug: None
Change-Id: I3c07613c76a32a628926569aab0e1076e48a0a79
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206983
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33262}
2021-02-15 14:38:47 +00:00
Niels Möller
6d17602e70 Replace some RecursiveCriticalSection with Mutex, in PhysicalSocketServer.
The one remaining RecursiveCriticalSection likely needs a bit more
care.

Bug: webrtc:11567
Change-Id: Ie81085969197bed03ac8e2d269b58653b86095e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206468
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33206}
2021-02-09 15:49:28 +00:00
Mirko Bonadei
e5f4c6b8d2 Reland "Refactor rtc_base build targets."
This is a reland of 69241a93fb

Fix: The problem was related to NO_MAIN_THREAD_WRAPPING, which
affects https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_base/thread.cc;l=257-263;drc=7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5.
The original CL didn't attach the definition of the macro
NO_MAIN_THREAD_WRAPPING when building for Chromium (which doesn't have
to be related to //rtc_base anymore but to //rtc_base:threading).

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

Bug: webrtc:9987
Change-Id: I7cdf49d2aac8357f1f50f90010bf2c2f62fa19f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202021
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33001}
2021-01-15 17:00:05 +00:00
Mirko Bonadei
7acc2d9fe3 Revert "Refactor rtc_base build targets."
This reverts commit 69241a93fb.

Reason for revert: Breaks WebRTC roll into Chromium.

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

TBR=mbonadei@webrtc.org,hta@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

No-Try: True
Bug: webrtc:9987
Change-Id: I1e36ad64cc60092f38d6886153a94f1a58339256
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201840
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32986}
2021-01-14 21:27:38 +00:00
Mirko Bonadei
69241a93fb Refactor rtc_base build targets.
The "//rtc_base:rtc_base" build target has historically been one of the
biggest targets in the WebRTC build. Big targets are the main source of
circular dependencies and non-API types leakage.

This CL is a step forward into splitting "//rtc_base:rtc_base" into
smaller targets (as originally started in 2018).

The only non-automated changes are (like re-wiring the build system):
* The creation of //rtc_base/async_resolver.{h,cc} which allows to
  break a circular dependency (is has been extracted from
  //rtc_base/net_helpers.{h,cc}).
* The creation of //rtc_base/internal/default_socket_server.{h,cc} to
  break another circular dependency.

Bug: webrtc:9987
Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32941}
2021-01-11 18:32:30 +00:00
Taylor Brandstetter
9d269408a4 Set TCP_NODELAY socket option before calling connect.
Setting the option after calling connect but before the socket is
connected fails in some circumstances on Windows, while setting it
before connecting always succeeds. That's what Chrome is doing;
TCPClientSocket::OpenSocket calls SetDefaultOptionsForClient (which
sets TCP_NODELAY) right after opening the socket.

Also, start logging errors, and storing last error when setsockopt
fails.

Bug: webrtc:12217
Change-Id: I169d52e31b50e54e5bc93ff3590bae656cacb2b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195060
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32696}
2020-11-26 01:00:22 +00:00
Taylor Brandstetter
7b69a44c8b Fix ABA problem when iterating epoll events.
Original patch contributed by andrey.semashev@gmail.com.

In PhysicalSocketServer::WaitEpoll(), the loop verifies that the
signalled dispatcher is in dispatchers_ set. It does so by looking up
the dispatcher pointer in the set. This is vulnerable to the ABA
problem because one dispatcher may be removed and destroyed and another
created and added with the same address before epoll reports an event
for the old dispatcher. The same issue exists for other Wait
implementations, if a dispatcher is removed and a new one added with
the same socket handle is the old.

This is avoided by using a 64-bit key for looking up the dispatcher
in the set. The key is set from a running counter which gets incremented
when a dispatcher is added to the set, so even if the same dispatcher
pointer is added, removed and added again, the key value will be
different.

This changes the storage of dispatchers_ from a set to a flat_hash_map,
which uses a bit more memory but has faster lookup (O(1) as opposed to
O(log n)).

Bug: webrtc:11124
Change-Id: I6d206e1a367b58ba971edca9b48af7664384b797
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181027
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32019}
2020-08-31 20:26:37 +00:00
Markus Handell
3cb525b378 Rename CriticalSection to RecursiveCriticalSection.
This name change communicates that the recursive critical section
should not be used for new code.
The relevant files are renamed rtc_base/critical_section* ->
rtc_base/deprecated/recursive_critical_section*

Bug: webrtc:11567
Change-Id: I73483a1c5e59c389407a981efbfc2cfe76ccdb43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179483
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31754}
2020-07-17 09:19:50 +00:00
Markus Handell
b7c63ab83a PhysicalSocketServer: remove heap-based epoll_event handling.
This change deletes heap-based handling of dynamic number of epoll
events handled per call to epoll, with the assumption
that PSS load is likely not dominated by the epoll syscalls. This
simplifies the logic in the code and removes a heap allocation.

Bug: webrtc:11567
Change-Id: I34fbe1fa8bf0a037bf849a4adac1a0a333c9dd86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175563
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31358}
2020-05-26 17:41:51 +00:00
Niels Möller
6ee67936bd Reland "Delete unused code to handle posix signals in PhysicalSocketServer"
This is a reland of d2490aef20
Earlier link errors were likely a single trybot with corrupted dep files.

Original change's description:
> Delete unused code to handle posix signals in PhysicalSocketServer
>
> Bug: None
> Change-Id: I3abddef4f1af5499f39a8d3f643c779effe9e01d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175006
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31237}

Bug: webrtc:11571
Change-Id: I7ea14f26a2186a9d51a75493b7280fc0ad6b8c77
Tbr: kwiberg@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175042
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31251}
2020-05-14 09:39:45 +00:00
Niels Möller
611fba4517 Mark construction time members of PhysicalSocketServer as const
Bug: webrtc:11567
Change-Id: I06d48aa1636ce1dc684e6a1f6332366be9df22d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175007
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31242}
2020-05-13 14:37:35 +00:00
Mirko Bonadei
ff88a64b67 Revert "Delete unused code to handle posix signals in PhysicalSocketServer"
This reverts commit d2490aef20.

Reason for revert: peerconnection_client fails to link.

Original change's description:
> Delete unused code to handle posix signals in PhysicalSocketServer
> 
> Bug: None
> Change-Id: I3abddef4f1af5499f39a8d3f643c779effe9e01d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175006
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31237}

TBR=kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: Ia5a44b4f1a54f6b444b8c53e64d1a3972d166728
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175011
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31240}
2020-05-13 13:48:28 +00:00
Niels Möller
d2490aef20 Delete unused code to handle posix signals in PhysicalSocketServer
Bug: None
Change-Id: I3abddef4f1af5499f39a8d3f643c779effe9e01d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175006
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31237}
2020-05-13 12:33:09 +00:00
Mirko Bonadei
f7f6870f1b Mark static const class/struct members as constexpr.
This change fixes declarations that have initial values but are
technically not definitions by marking them constexpr (which counts as a
definition).

Bug: None
Change-Id: Icbecf8d83faffa83b9f7e1ffe4d6ef3a3f0b0c2a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173587
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31073}
2020-04-15 09:30:07 +00:00
mmorrison
25eeda1872 Fix socket not getting registered for epoll events
When epoll is enabled in the PhysicalSocketServer, a socket may
not get registered for its epoll events. If an AsyncSocket is
closed and re-created during one of its signal callbacks, its
old epoll events and new epolls events bitmasks may be the same,
even though the fd has changed. This causes the epoll implementation
to not register the new fd for any events.

Fix this by resetting the saved events bitmask when the socket is
closed. This ensures the new fd, if any, is registered if needed.

Bug: webrtc:11497
Change-Id: Idea499e09aefdf292430d1a774a046f963603b95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173103
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31039}
2020-04-09 10:17:47 +00:00
Paulina Hensman
b239a2e357 Remove some more instances of IP logging.
Bug: b/152662380
Change-Id: I1f33f470c4dd5458c2d2598e2f17f6691f72df4a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172446
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30957}
2020-04-01 08:17:47 +00:00
Taylor Brandstetter
ecd6fc84cf Add DSCP support for POSIX platforms.
This CL only includes the necessary changes in PhysicalSocketServer,
and doesn't include the Java or Objective C API.

Note that this is doing exactly the same thing as UDPSocketPosix
in chromium.

BUG=webrtc:5658

Change-Id: I295455eaccba2a83cdd1bc55848f325c310f8d32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168260
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30478}
2020-02-07 03:25:28 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Mirko Bonadei
108a2f025d Preventively fix missing braces warnings.
This CL fixes warnings that will cause issues with new versions of the
Android NDK.

Bug: None
Change-Id: Icd119efec6039d4861d89401b84f94c8da29a314
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160080
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29851}
2019-11-20 19:38:55 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00