summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2016-03-20 22:00:43 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2016-03-20 22:00:43 +0100
commitc5e2f449847f8663d53bcd6dab64efa297a2ab70 (patch)
tree76cc1aeefcdf10460f49336bb569828d581d9a00
parent795b7de80891d51adfb912798ca954431cbf702b (diff)
parent550fe6f010f682d352077579d5056609a68e9814 (diff)
downloadirssi-c5e2f449847f8663d53bcd6dab64efa297a2ab70.zip
Merge pull request #444 from LemonBoy/timeout-id
Use 0 as a sentinel value for sasl_timeout
-rw-r--r--src/irc/core/sasl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/irc/core/sasl.c b/src/irc/core/sasl.c
index db099368..b74b6a8c 100644
--- a/src/irc/core/sasl.c
+++ b/src/irc/core/sasl.c
@@ -34,7 +34,7 @@ static gboolean sasl_timeout(IRC_SERVER_REC *server)
irc_send_cmd_now(server, "AUTHENTICATE *");
cap_finish_negotiation(server);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
signal_emit("server sasl failure", 2, server, "The authentication timed out");
@@ -64,9 +64,9 @@ 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) {
+ if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
}
params = event_get_params(data, 2, NULL, &error);
@@ -81,9 +81,9 @@ static void sasl_fail(IRC_SERVER_REC *server, const char *data, const char *from
static void sasl_already(IRC_SERVER_REC *server, const char *data, const char *from)
{
- if (server->sasl_timeout != -1) {
+ if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
}
signal_emit("server sasl success", 1, server);
@@ -94,9 +94,9 @@ static void sasl_already(IRC_SERVER_REC *server, const char *data, const char *f
static void sasl_success(IRC_SERVER_REC *server, const char *data, const char *from)
{
- if (server->sasl_timeout != -1) {
+ if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
}
signal_emit("server sasl success", 1, server);
@@ -114,9 +114,9 @@ static void sasl_step(IRC_SERVER_REC *server, const char *data, const char *from
conn = server->connrec;
/* Stop the timer */
- if (server->sasl_timeout != -1) {
+ if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
}
switch (conn->sasl_mechanism) {
@@ -161,9 +161,9 @@ static void sasl_disconnected(IRC_SERVER_REC *server)
return;
}
- if (server->sasl_timeout != -1) {
+ if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
- server->sasl_timeout = -1;
+ server->sasl_timeout = 0;
}
}