struct timeval tv;
struct worker_task *task;
struct storage_server *server;
+ int fd;
};
struct fuzzy_learn_session {
struct controller_session *session;
struct storage_server *server;
struct worker_task *task;
+ int fd;
};
static struct fuzzy_ctx *fuzzy_module_ctx = NULL;
struct fuzzy_client_session *session = ud;
event_del (&session->ev);
+ close (session->fd);
session->task->save.saved--;
if (session->task->save.saved == 0) {
/* Call other filters */
}
goto ok;
}
+ else {
+ goto err;
+ }
return;
err:
msg_err ("got error on IO with server %s:%d, %d, %s", session->server->name, session->server->port, errno, strerror (errno));
ok:
- close (fd);
remove_normal_event (session->task->s, fuzzy_io_fin, session);
}
struct fuzzy_learn_session *session = arg;
event_del (&session->ev);
+ close (session->fd);
(*session->saved)--;
if (*session->saved == 0) {
session->session->state = STATE_REPLY;
}
goto err;
}
+ else {
+ goto err;
+ }
return;
r = snprintf (buf, sizeof (buf), "Error" CRLF);
rspamd_dispatcher_write (session->session->dispatcher, buf, r, FALSE, FALSE);
ok:
- close (fd);
remove_normal_event (session->session->s, fuzzy_learn_fin, session);
}
session->state = 0;
session->h = part->fuzzy;
session->task = task;
+ session->fd = sock;
session->server = selected;
event_add (&session->ev, &session->tv);
register_async_event (task->s, fuzzy_io_fin, session, FALSE);
s->cmd = cmd;
s->value = value;
s->saved = saved;
+ s->fd = sock;
event_add (&s->ev, &s->tv);
(*saved)++;
register_async_event (session->s, fuzzy_learn_fin, s, FALSE);