summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-20 19:14:59 +0200
committerlouiz’ <louiz@louiz.org>2017-04-20 19:14:59 +0200
commit69fd6cc4c3b88443ce98ae32e34909654feb1e4f (patch)
treeb2232f5aad5e8a2dd1bb049563c75c7d6a3b3e8b /src/network
parent78765a4bc47cb41f88fac99c72b5cd66da8ae486 (diff)
downloadbiboumi-69fd6cc4c3b88443ce98ae32e34909654feb1e4f.tar.gz
biboumi-69fd6cc4c3b88443ce98ae32e34909654feb1e4f.tar.bz2
biboumi-69fd6cc4c3b88443ce98ae32e34909654feb1e4f.tar.xz
biboumi-69fd6cc4c3b88443ce98ae32e34909654feb1e4f.zip
Explicitely init the msghdr fields, to be compatible with any implementation
Diffstat (limited to 'src/network')
-rw-r--r--src/network/tcp_socket_handler.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/network/tcp_socket_handler.cpp b/src/network/tcp_socket_handler.cpp
index 1bb8bf3..789a4a7 100644
--- a/src/network/tcp_socket_handler.cpp
+++ b/src/network/tcp_socket_handler.cpp
@@ -125,9 +125,14 @@ 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{nullptr, 0,
- msg_iov,
- 0, nullptr, 0, 0};
+ struct msghdr msg;
+ msg.msg_name = nullptr;
+ msg.msg_namelen = 0;
+ 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