summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-09-11 23:20:07 +0200
committerLemonBoy <thatlemon@gmail.com>2015-09-11 23:20:07 +0200
commit49c4ea5fd94c9eee17dc5a8e0691ba1da9bf33b7 (patch)
tree3dde2169f29ab6f4f762a955705df5c9bf251213
parent1f114d75c6db16726bcb930044b7312e4c851eaa (diff)
downloadirssi-49c4ea5fd94c9eee17dc5a8e0691ba1da9bf33b7.zip
Parse the error string received by the server
So that in case of SASL failure the user sees a nice error message.
-rw-r--r--src/irc/core/sasl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/irc/core/sasl.c b/src/irc/core/sasl.c
index 8f3b823f..874b67f3 100644
--- a/src/irc/core/sasl.c
+++ b/src/irc/core/sasl.c
@@ -41,16 +41,22 @@ static void sasl_start (IRC_SERVER_REC *server, const char *data, const char *fr
static void sasl_fail (IRC_SERVER_REC *server, const char *data, const char *from)
{
+ char *params, *error;
+
/* Stop any pending timeout, if any */
if (server->sasl_timeout != -1) {
g_source_remove(server->sasl_timeout);
server->sasl_timeout = -1;
}
- g_critical("Authentication failed with reason \"%s\"", data);
+ params = event_get_params(data, 2, NULL, &error);
+
+ g_critical("Authentication failed with reason \"%s\"", error);
/* Terminate the negotiation */
cap_finish_negotiation(server);
+
+ g_free(params);
}
static void sasl_already (IRC_SERVER_REC *server, const char *data, const char *from)