Skip to content

Commit

Permalink
Demote sendmsg() warning and reduce and iov array size
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Jul 18, 2024
1 parent fd8c49a commit f92369c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/linux/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ namespace platf {
// UDP GSO on Linux currently only supports sending 64K or 64 segments at a time
size_t seg_index = 0;
const size_t seg_max = 65536 / 1500;
struct iovec iovs[(send_info.headers ? send_info.block_count : 1) * max_iovs_per_msg] = {};
struct iovec iovs[(send_info.headers ? std::min(seg_max, send_info.block_count) : 1) * max_iovs_per_msg] = {};
auto msg_size = send_info.header_size + send_info.payload_size;

Check warning on line 444 in src/platform/linux/misc.cpp

View check run for this annotation

Codecov / codecov/patch

src/platform/linux/misc.cpp#L444

Added line #L444 was not covered by tests
while (seg_index < send_info.block_count) {
int iovlen = 0;

Check warning on line 446 in src/platform/linux/misc.cpp

View check run for this annotation

Codecov / codecov/patch

src/platform/linux/misc.cpp#L446

Added line #L446 was not covered by tests
Expand Down Expand Up @@ -509,7 +509,7 @@ namespace platf {
continue;
}

BOOST_LOG(warning) << "sendmsg() failed: "sv << errno;
BOOST_LOG(verbose) << "sendmsg() failed: "sv << errno;
break;
}

Expand Down

0 comments on commit f92369c

Please sign in to comment.