summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-20 15:44:46 +0200
committerlouiz’ <louiz@louiz.org>2017-04-20 15:44:46 +0200
commitcf87cf089251eddf2c33322e07b0cde9f70ec24b (patch)
tree8ac72bcb53e41f9f7db00e111b5d03b6a1cd1795
parent06094245e9c17d10f7df835d1f9ad1a679b1bf67 (diff)
downloadbiboumi-cf87cf089251eddf2c33322e07b0cde9f70ec24b.tar.gz
biboumi-cf87cf089251eddf2c33322e07b0cde9f70ec24b.tar.bz2
biboumi-cf87cf089251eddf2c33322e07b0cde9f70ec24b.tar.xz
biboumi-cf87cf089251eddf2c33322e07b0cde9f70ec24b.zip
Better way to init the msghdr fields
-rw-r--r--src/network/tcp_socket_handler.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/network/tcp_socket_handler.cpp b/src/network/tcp_socket_handler.cpp
index 789a4a7..02265ec 100644
--- a/src/network/tcp_socket_handler.cpp
+++ b/src/network/tcp_socket_handler.cpp
@@ -125,14 +125,9 @@ ssize_t TCPSocketHandler::do_recv(void* recv_buf, const size_t buf_size)
void TCPSocketHandler::on_send()
{
struct iovec msg_iov[UIO_FASTIOV] = {};
- struct msghdr msg;
- msg.msg_name = nullptr;
- msg.msg_namelen = 0;
+ struct msghdr msg{};
msg.msg_iov = msg_iov;
msg.msg_iovlen = 0;
- msg.msg_control = nullptr;
- msg.msg_controllen = 0;
- msg.msg_flags = 0;
for (const std::string& s: this->out_buf)
{
// unconsting the content of s is ok, sendmsg will never modify it