summaryrefslogtreecommitdiff
path: root/zyklonb.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-06 21:35:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-06 21:35:44 +0200
commitc3d62b87996337130f7cdfe6787c92d882196be2 (patch)
tree515e0ca021dc3e5ef3c2b6754653245fd2f92281 /zyklonb.c
parentec842db0fbd3e57b49d0b9a232bd102d54596d0f (diff)
downloadxK-c3d62b87996337130f7cdfe6787c92d882196be2.tar.gz
xK-c3d62b87996337130f7cdfe6787c92d882196be2.tar.xz
xK-c3d62b87996337130f7cdfe6787c92d882196be2.zip
Avoid the "poller_fd::closed" feature
Reliability enhancement for Linux. This feature was created for ponymap, however we don't care about an extra syscall in most places. Doing it right even saves lines.
Diffstat (limited to 'zyklonb.c')
-rw-r--r--zyklonb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/zyklonb.c b/zyklonb.c
index fd0c80a..d3de92d 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -203,8 +203,8 @@ bot_context_free (struct bot_context *self)
if (self->irc_fd != -1)
{
- xclose (self->irc_fd);
poller_fd_reset (&self->irc_event);
+ xclose (self->irc_fd);
}
if (self->ssl)
SSL_free (self->ssl);
@@ -1585,13 +1585,11 @@ on_irc_disconnected (struct bot_context *ctx)
ctx->ssl_ctx = NULL;
}
+ poller_fd_reset (&ctx->irc_event);
xclose (ctx->irc_fd);
ctx->irc_fd = -1;
ctx->irc_registered = false;
- ctx->irc_event.closed = true;
- poller_fd_reset (&ctx->irc_event);
-
// TODO: inform plugins about the disconnect event
// All of our timers have lost their meaning now