From 12968ba98642bd7057e8e7f41e184ab2d61671ed Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 3 May 2018 12:10:02 +0200 Subject: lib: Make UNIX socket buffer size configurable This makes the buffer size used by the UNIX sockets configurable. In case of a lot of IPCPs in the system it might become too small with the default value, resulting in irm command failures. The user can now easily configure it with an adequate value. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/ipcpd/ipcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/ipcp.c') diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index dfb88057..8dc7751a 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -55,7 +55,7 @@ struct cmd { struct list_head next; - uint8_t cbuf[IPCP_MSG_BUF_SIZE]; + uint8_t cbuf[SOCK_BUF_SIZE]; size_t len; int fd; }; @@ -146,7 +146,7 @@ static void * acceptloop(void * o) break; } - cmd->len = read(csockfd, cmd->cbuf, IPCP_MSG_BUF_SIZE); + cmd->len = read(csockfd, cmd->cbuf, SOCK_BUF_SIZE); if (cmd->len <= 0) { log_err("Failed to read from socket."); close(csockfd); -- cgit v1.2.3