From 94ab6f9585df00595bd46c8affb7fb5d202f0ea8 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 23 Oct 2019 16:52:44 -0400 Subject: Respond to pings --- server.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index 5cb7776..1583d1c 100644 --- a/server.c +++ b/server.c @@ -155,7 +155,10 @@ void serverLogin( } void serverAuth(void) { + assert(authBase64); format("AUTHENTICATE PLAIN\r\nAUTHENTICATE %s\r\nCAP END\r\n", authBase64); + free(authBase64); + authBase64 = NULL; } void serverJoin(const char *join) { @@ -180,8 +183,13 @@ void serverRecv(void) { crlf[0] = '\0'; if (verbose) fprintf(stderr, "\x1B[32m%s\x1B[m\n", line); - // TODO: Add line to ring if stateReady(). - stateParse(line); + if (!strncmp(line, "PING ", 5)) { + line[1] = 'O'; + format("%s\r\n", line); + } else { + // TODO: Add line to ring if stateReady(). + stateParse(line); + } line = crlf + 2; } -- cgit 1.4.1