From e3b522c39b04f57f0a4cfeeab437e8ad5650c104 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 2 Nov 2018 14:55:36 +0100 Subject: [PATCH] socket: use pre-allocated buffers to avoid dynamic allocations and syscalls in critical path --- lib/nodes/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nodes/socket.c b/lib/nodes/socket.c index fe9cd0587..73eb0e411 100644 --- a/lib/nodes/socket.c +++ b/lib/nodes/socket.c @@ -471,12 +471,12 @@ int socket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned * retry: ret = io_sprint(&s->io, s->out.buf, s->out.buflen, &wbytes, smps, cnt); if (ret < 0) { - warn("Failed to format payload: reason=%d", ret); + warning("Failed to format payload: reason=%d", ret); return ret; } if (wbytes == 0) { - warn("Failed to format payload: wbytes=%zu", wbytes); + warning("Failed to format payload: wbytes=%zu", wbytes); return -1; } @@ -524,7 +524,7 @@ retry2: bytes = sendto(s->sd, s->out.buf, wbytes, 0, (struct sockaddr *) &s->rem } if (bytes != wbytes) - warning("Partial send to node %s", node_name(n)); + warning("Partial sendto() to node %s", node_name(n)); return cnt; }