From 876b2f8e699c1b24ae5e4f98a4affe9fa1a8650f Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Sun, 23 Mar 2025 20:34:26 +0100 Subject: add a request status, so that multiple clients cannot overwrite requests from other clients --- src/common/shared_memory.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/shared_memory.h b/src/common/shared_memory.h index fe101ea..1798ad1 100644 --- a/src/common/shared_memory.h +++ b/src/common/shared_memory.h @@ -14,11 +14,14 @@ */ enum Operations { INSERT, DELETE, GET, PRINT }; +enum Status { FREE, SENT, PROCESSED}; + /** * @brief One request constists out of the operation, the arguments and the response. */ struct Request { Operations type; + Status status = FREE; char key[MAX_KEY_SIZE]; char value[MAX_VALUE_SIZE]; char response[MAX_VALUE_SIZE]; @@ -38,7 +41,6 @@ struct SharedMemory { int tail; int head; - bool full; }; /** -- cgit 1.4.1