instead of checking for a failure state, and missing some
failure states
rlm_sql_mysql_conn_t *c;
char const *log_prefix = conn->name;
- if ((conn->state == CONNECTION_STATE_HALTED) || (conn->state == CONNECTION_STATE_CLOSED)) {
+ if (!((conn->state == CONNECTION_STATE_CONNECTING) || (conn->state == CONNECTION_STATE_CONNECTED))) {
ROPTIONAL(RERROR, ERROR, "Connection not available for escaping");
return -1;
}
rlm_sql_postgres_conn_t *c;
int err;
- if ((conn->state == CONNECTION_STATE_HALTED) || (conn->state == CONNECTION_STATE_CLOSED)) {
+ if (!((conn->state == CONNECTION_STATE_CONNECTING) || (conn->state == CONNECTION_STATE_CONNECTED))) {
ROPTIONAL(RERROR, ERROR, "Connection not available for escaping");
return -1;
}