From b3ad8920fcdfa3af72e0e535ae798955e536539b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 26 Dec 2019 14:20:09 -0500 Subject: Handle ERROR --- litterbox.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'litterbox.c') diff --git a/litterbox.c b/litterbox.c index 2a156b1..3a54bf5 100644 --- a/litterbox.c +++ b/litterbox.c @@ -436,6 +436,13 @@ static void handlePing(struct Message *msg) { format("PONG :%s\r\n", msg->params[0]); } +static void handleError(struct Message *msg) { + require(msg, false, 1); + tls_close(client); + dbClose(); + errx(EX_UNAVAILABLE, "%s", msg->params[0]); +} + static const struct { const char *cmd; bool transaction; @@ -450,6 +457,7 @@ static const struct { { "375", false, handleReplyMOTDStart }, { "376", true, handleReplyEndOfMOTD }, { "CAP", false, handleCap }, + { "ERROR", false, handleError }, { "JOIN", true, handleJoin }, { "KICK", true, handleKick }, { "NICK", true, handleNick }, -- cgit 1.4.1