From e2be3c85131896e203f7ba16d883bc61bfa09064 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 23 Oct 2019 18:51:57 -0400 Subject: Synchronize state after client registration --- bounce.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bounce.h') diff --git a/bounce.h b/bounce.h index 0929da7..fd64a27 100644 --- a/bounce.h +++ b/bounce.h @@ -29,6 +29,8 @@ #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) +bool verbose; + enum { ParamCap = 15 }; struct Command { const char *origin; @@ -50,15 +52,10 @@ static inline struct Command parse(char *line) { return cmd; } -bool verbose; - 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); -bool stateReady(void); -void stateParse(char *line); - int serverConnect(const char *host, const char *port); void serverLogin( const char *pass, const char *auth, @@ -74,3 +71,8 @@ struct Client *clientAlloc(struct tls *tls); void clientFree(struct Client *client); bool clientClose(const struct Client *client); void clientRecv(struct Client *client); +void clientSend(struct Client *client, const char *ptr, size_t len); + +bool stateReady(void); +void stateParse(char *line); +void stateSync(struct Client *client); -- cgit 1.4.1