From 3f243081d85ca02188ccdd61ae3476ed9df933e1 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 25 Oct 2019 02:27:05 -0400 Subject: Implement client reading from ring buffer It's still messy but it works!! --- bounce.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bounce.h') diff --git a/bounce.h b/bounce.h index d81acf9..d4ec916 100644 --- a/bounce.h +++ b/bounce.h @@ -53,6 +53,11 @@ static inline struct Message parse(char *line) { return msg; } +void ringWrite(const char *line); +size_t ringReader(const char *name); +size_t ringDiff(size_t reader); +const char *ringRead(time_t *time, size_t reader); + void listenConfig(const char *cert, const char *priv); size_t listenBind(int fds[], size_t cap, const char *host, const char *port); int listenAccept(struct tls **client, int fd); @@ -76,12 +81,9 @@ void clientRecv(struct Client *client); void clientSend(struct Client *client, const char *ptr, size_t len); void clientFormat(struct Client *client, const char *format, ...) __attribute__((format(printf, 2, 3))); +size_t clientDiff(const struct Client *client); +void clientRead(struct Client *client); bool stateReady(void); void stateParse(char *line); void stateSync(struct Client *client); - -void ringWrite(const char *line); -size_t ringReader(const char *name); -size_t ringDiff(size_t reader); -const char *ringRead(time_t *time, size_t reader); -- cgit 1.4.1