commit 266040fcc12715945edec022623f2dc45be31455
parent 1fbc3336a593e7b34420172efbe81f0f4aa65ad3
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Mon, 22 Dec 2014 01:04:32 +0000
Renormalize buffer size, even if we lose 1 char
Diffstat:
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/include/skalibs/buffer.h b/src/include/skalibs/buffer.h
@@ -27,11 +27,11 @@ struct buffer_s
so that the head == tail case is nonambiguous (empty, not full).
*/
-#define BUFFER_INSIZE 8193
-#define BUFFER_OUTSIZE 8193
-#define BUFFER_ERRSIZE 1025
-#define BUFFER_INSIZE_SMALL 513
-#define BUFFER_OUTSIZE_SMALL 513
+#define BUFFER_INSIZE 8192
+#define BUFFER_OUTSIZE 8192
+#define BUFFER_ERRSIZE 1024
+#define BUFFER_INSIZE_SMALL 512
+#define BUFFER_OUTSIZE_SMALL 512
#define BUFFER_INIT(f, d, buf, len) { .op = (f), .fd = (d), .c = CBUFFER_INIT(buf, len) }
extern int buffer_init (buffer *, buffer_io_func_t *, int, char *, unsigned int) ;
diff --git a/src/include/skalibs/iobuffer.h b/src/include/skalibs/iobuffer.h
@@ -3,7 +3,7 @@
#ifndef IOBUFFER_H
#define IOBUFFER_H
-#define IOBUFFER_SIZE 65537U
+#define IOBUFFER_SIZE 65536U
/* iobufferu */
diff --git a/src/include/skalibs/unirandom.h b/src/include/skalibs/unirandom.h
@@ -6,7 +6,7 @@
#include <skalibs/buffer.h>
#include <skalibs/surf.h>
-#define RANDOMBUF_BUFSIZE 257
+#define RANDOMBUF_BUFSIZE 256
struct randombuf_s
{
diff --git a/src/include/skalibs/unixmessage.h b/src/include/skalibs/unixmessage.h
@@ -37,9 +37,9 @@ struct unixmessage_v_s
#define UNIXMESSAGE_V_ZERO { .v = 0, .vlen = 0, .fds = 0, .nfds = 0 }
extern unixmessage_v_t const unixmessage_v_zero ;
-#define UNIXMESSAGE_BUFSIZE 2049
-#define UNIXMESSAGE_AUXBUFSIZE 2049
-#define UNIXMESSAGE_MAXFDS 256
+#define UNIXMESSAGE_BUFSIZE 2048
+#define UNIXMESSAGE_MAXFDS 255
+#define UNIXMESSAGE_AUXBUFSIZE (sizeof(int) * UNIXMESSAGE_MAXFDS + 1)
#define UNIXMESSAGE_MAXREADS 32