}
}
static void
-rspamd_fuzzy_redis_session_dtor (struct rspamd_fuzzy_redis_session *session)
+rspamd_fuzzy_redis_session_dtor (struct rspamd_fuzzy_redis_session *session,
+ gboolean is_fatal)
{
redisAsyncContext *ac;
ac = session->ctx;
session->ctx = NULL;
rspamd_redis_pool_release_connection (session->backend->pool,
- ac, FALSE);
+ ac, is_fatal);
}
if (event_get_base (&session->timeout)) {
session->callback.cb_check (&rep, session->cbdata);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
}
else {
/* Add timeout */
rspamd_upstream_fail (session->up);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, FALSE);
}
static void
session->callback.cb_check (&rep, session->cbdata);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
}
else {
/* Add timeout */
rspamd_upstream_fail (session->up);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, FALSE);
}
void
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
memset (&rep, 0, sizeof (rep));
if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_check_callback,
session, session->nargs,
(const gchar **)session->argv, session->argv_lens) != REDIS_OK) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
memset (&rep, 0, sizeof (rep));
rspamd_upstream_fail (session->up);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, FALSE);
}
void
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
cb (0, ud);
if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_count_callback,
session, session->nargs,
(const gchar **)session->argv, session->argv_lens) != REDIS_OK) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
cb (0, ud);
rspamd_upstream_fail (session->up);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, FALSE);
}
void
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
cb (0, ud);
if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_version_callback,
session, session->nargs,
(const gchar **)session->argv, session->argv_lens) != REDIS_OK) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
cb (0, ud);
rspamd_upstream_fail (session->up);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, FALSE);
}
void
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
cb (FALSE, ud);
if (cb) {
cb (FALSE, ud);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
return;
}
if (cb) {
cb (FALSE, ud);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
return;
}
if (cb) {
cb (FALSE, ud);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
return;
}
if (cb) {
cb (FALSE, ud);
}
- rspamd_fuzzy_redis_session_dtor (session);
+ rspamd_fuzzy_redis_session_dtor (session, TRUE);
return;
}