From 266040fcc12715945edec022623f2dc45be31455 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 22 Dec 2014 01:04:32 +0000 Subject: Renormalize buffer size, even if we lose 1 char --- src/include/skalibs/buffer.h | 10 +++++----- src/include/skalibs/iobuffer.h | 2 +- src/include/skalibs/unirandom.h | 2 +- src/include/skalibs/unixmessage.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/include') diff --git a/src/include/skalibs/buffer.h b/src/include/skalibs/buffer.h index 9060d08..5cf0950 100644 --- 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 index 93a98c5..b6abd2d 100644 --- 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 index ecbe6de..818990e 100644 --- a/src/include/skalibs/unirandom.h +++ b/src/include/skalibs/unirandom.h @@ -6,7 +6,7 @@ #include #include -#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 index 28e084c..ab9b942 100644 --- 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 -- cgit v1.2.3