summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--server.c12
1 files changed, 10 insertions, 2 deletions
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;
 	}
6a75bb156f396587122&follow=1'>Add c script to READMEJune McEnroe 2020-05-31Add c scriptJune McEnroe 2020-05-31Update mdoc source URLsJune McEnroe 2020-05-26Remove unfinished PSF fontsJune McEnroe