aboutsummaryrefslogtreecommitdiff
blob: b59d6c4283f2809d97ff7610f5f7568e27142935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 48104199ceb938ad21b4573958c16c224dfeff60 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Fri, 22 Jul 2022 18:13:11 +0200
Subject: [PATCH] musl hacks ii

---
 .../chromium/net/socket/udp_socket_posix.cc      | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
index 71265568b..7d82331f9 100644
--- a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
+++ b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
@@ -1151,8 +1151,20 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
   for (auto& buffer : buffers)
     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
   msgvec->reserve(buffers.size());
-  for (size_t j = 0; j < buffers.size(); j++)
-    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
+  for (size_t j = 0; j < buffers.size(); j++) {
+    auto hdr = new msghdr;
+    hdr->msg_name = nullptr;
+    hdr->msg_namelen = 0;
+    hdr->msg_iov = &msg_iov[j];
+    hdr->msg_iovlen = 1;
+    hdr->__pad1 = 0;
+    hdr->msg_control = 0;
+    hdr->msg_controllen = 0;
+    hdr->__pad2 = 0;
+    hdr->msg_flags = 0;
+    msgvec->push_back({hdr, 0});
+    // msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
+  }
   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
   SendResult send_result(0, 0, std::move(buffers));
   if (result < 0) {
-- 
2.35.1