From 07da9aeb32d89dd7265ece6c0297b8c4d7bbd56b Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 24 Jun 2026 09:39:39 -0700 Subject: [PATCH] minor --- modules/database/src/ioc/rsrv/camsgtask.c | 2 +- modules/database/src/ioc/rsrv/server.h | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/database/src/ioc/rsrv/camsgtask.c b/modules/database/src/ioc/rsrv/camsgtask.c index b69a39458..8a10823f9 100644 --- a/modules/database/src/ioc/rsrv/camsgtask.c +++ b/modules/database/src/ioc/rsrv/camsgtask.c @@ -114,7 +114,7 @@ void camsgtask ( void *pParm ) client->recv.cnt += ( unsigned ) nchars; status = camessage ( client ); - if (status == 0) { + if (status == RSRV_OK) { /* * if there is a partial message * align it with the start of the buffer diff --git a/modules/database/src/ioc/rsrv/server.h b/modules/database/src/ioc/rsrv/server.h index 604880c12..b674fe79c 100644 --- a/modules/database/src/ioc/rsrv/server.h +++ b/modules/database/src/ioc/rsrv/server.h @@ -55,10 +55,19 @@ typedef struct caHdrLargeArray { enum messageBufferType { mbtUDP, mbtSmallTCP, mbtLargeTCP }; struct message_buffer { char *buf; - /*! points to first filled byte in buffer */ + /* Invariants: stk <= cnt <= maxstk + * + * buf : |-*****-----| + * ^ ^ ^ + * | | \- maxstk + * | \------ cnt + * \----------- stk + */ + /* points to first filled byte in buffer */ unsigned stk; + /* allocated capacity of buffer */ unsigned maxstk; - /*! points to first unused byte in buffer (after filled bytes) */ + /* points to first unused byte in buffer (after filled bytes) */ unsigned cnt; enum messageBufferType type; };