diff options
Diffstat (limited to '')
-rw-r--r-- | src/mds-server/mds-server.h | 125 |
1 files changed, 2 insertions, 123 deletions
diff --git a/src/mds-server/mds-server.h b/src/mds-server/mds-server.h index 1e3869f..b2dafd4 100644 --- a/src/mds-server/mds-server.h +++ b/src/mds-server/mds-server.h @@ -19,130 +19,9 @@ #define MDS_MDS_SERVER_H -#include <libmdsserver/mds-message.h> +#include "client.h" -#include <stdlib.h> -#include <pthread.h> -#include <stdint.h> - - - -/** - * A condition for a message being intercepted by a client - */ -typedef struct interception_condition -{ - /** - * The header of messages to intercept, optionally with a value, - * empty (most not be NULL) for all messages. - */ - char* condition; - - /** - * The hash of the header of messages to intercept - */ - size_t header_hash; - - /** - * The interception priority. The client should be - * consistent with the priority for conditions that - * are not mutually exclusive. - */ - int64_t priority; - - /** - * Whether the messages may get modified by the client - */ - int modifying; - -} interception_condition_t; - - -/** - * Client information structure - */ -typedef struct client -{ - /** - * The client's entry in the list of clients - */ - ssize_t list_entry; - - /** - * The socket file descriptor for the socket connected to the client - */ - int socket_fd; - - /** - * Whether the socket is open - */ - int open; - - /** - * Message read buffer for the client - */ - mds_message_t message; - - /** - * The read thread for the client - */ - pthread_t thread; - - /** - * The client's ID - */ - uint64_t id; - - /** - * Mutex for sending data and other - * actions that only affacts this client - */ - pthread_mutex_t mutex; - - /** - * The messages interception conditions conditions - * for the client - */ - interception_condition_t* interception_conditions; - - /** - * The number of interception conditions - */ - size_t interception_conditions_count; - - /** - * Messages pending to be sent (concatenated) - */ - char* send_pending; - - /** - * The character length of the messages pending to be sent - */ - size_t send_pending_size; - -} client_t; - -/** - * A queued interception - */ -typedef struct queued_interception -{ - /** - * The intercepting client - */ - client_t* client; - - /** - * The interception priority - */ - int64_t priority; - - /** - * Whether the messages may get modified by the client - */ - int modifying; - -} queued_interception_t; +#include <stddef.h> |