From: Egor Date: Mon, 2 May 2022 19:58:09 +0000 (+0300) Subject: add error messages for parsing failures X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=ca02216ca9405c541a56355f696da7a7c998e119;p=patchyircd.git add error messages for parsing failures --- diff --git a/irc.c b/irc.c index e045c96..b364243 100644 --- a/irc.c +++ b/irc.c @@ -13,12 +13,16 @@ int processPacket(struct client_data *client) { { // remove \r char *end = strchr(p, '\n'); if (!end) { + printf("Client %"PRISocket" sent a NULL\n", client->FD); + fflush(stdout); killConnection(client, false); return 1; // null detected } if (end > p && end[-1] == '\r') end[-1] = '\n'; if (strchr(p, '\r')) { + printf("Client %"PRISocket" sent an extra CR\n", client->FD); + fflush(stdout); killConnection(client, false); return 1; // internal \r detected }