summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/rtc_base/physical_socket_server.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/libwebrtc/rtc_base/physical_socket_server.cc
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/physical_socket_server.cc')
-rw-r--r--third_party/libwebrtc/rtc_base/physical_socket_server.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/libwebrtc/rtc_base/physical_socket_server.cc b/third_party/libwebrtc/rtc_base/physical_socket_server.cc
index 95ba130e91..a5fe32722b 100644
--- a/third_party/libwebrtc/rtc_base/physical_socket_server.cc
+++ b/third_party/libwebrtc/rtc_base/physical_socket_server.cc
@@ -435,6 +435,31 @@ int PhysicalSocket::RecvFrom(void* buffer,
SocketAddress* out_addr,
int64_t* timestamp) {
int received = DoReadFromSocket(buffer, length, out_addr, timestamp);
+
+ UpdateLastError();
+ int error = GetError();
+ bool success = (received >= 0) || IsBlockingError(error);
+ if (udp_ || success) {
+ EnableEvents(DE_READ);
+ }
+ if (!success) {
+ RTC_LOG_F(LS_VERBOSE) << "Error = " << error;
+ }
+ return received;
+}
+
+int PhysicalSocket::RecvFrom(ReceiveBuffer& buffer) {
+ int64_t timestamp = -1;
+ static constexpr int BUF_SIZE = 64 * 1024;
+ buffer.payload.EnsureCapacity(BUF_SIZE);
+
+ int received =
+ DoReadFromSocket(buffer.payload.data(), buffer.payload.capacity(),
+ &buffer.source_address, &timestamp);
+ buffer.payload.SetSize(received > 0 ? received : 0);
+ if (received > 0 && timestamp != -1) {
+ buffer.arrival_time = webrtc::Timestamp::Micros(timestamp);
+ }
UpdateLastError();
int error = GetError();
bool success = (received >= 0) || IsBlockingError(error);