summary refs log tree commit diff
path: root/bounce.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-23 18:51:57 -0400
committerJune McEnroe <june@causal.agency>2019-10-23 18:51:57 -0400
commite2be3c85131896e203f7ba16d883bc61bfa09064 (patch)
treefbea6de725284cba7a7c06f5a4b28ff247eba599 /bounce.h
parentSend to server if client has no needs (diff)
downloadpounce-e2be3c85131896e203f7ba16d883bc61bfa09064.tar.gz
pounce-e2be3c85131896e203f7ba16d883bc61bfa09064.zip
Synchronize state after client registration
Diffstat (limited to 'bounce.h')
-rw-r--r--bounce.h12
1 files changed, 7 insertions, 5 deletions
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);