Skip to content

Commit

Permalink
tls: missing sessions db means nothing to prune
Browse files Browse the repository at this point in the history
  • Loading branch information
elliefm committed Dec 5, 2017
1 parent 5ef1ff2 commit 1e7cf05
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions imap/tls.c
Expand Up @@ -1373,12 +1373,7 @@ EXPORTED int tls_prune_sessions(void)
}

ret = cyrusdb_open(DB, fname, 0, &sessdb);
if (ret != CYRUSDB_OK) {
syslog(LOG_ERR, "DBERROR: opening %s: %s",
fname, cyrusdb_strerror(ret));
return 1;
}
else {
if (ret == CYRUSDB_OK) {
/* check each session in our database */
sess_dbopen = 1;
prock.count = prock.deletions = 0;
Expand All @@ -1390,6 +1385,15 @@ EXPORTED int tls_prune_sessions(void)
syslog(LOG_NOTICE, "tls_prune: purged %d out of %d entries",
prock.deletions, prock.count);
}
else if (ret == CYRUSDB_NOTFOUND) {
syslog(LOG_NOTICE, "tls_prune: %s not found, nothing to do", fname);
return 0;
}
else {
syslog(LOG_ERR, "DBERROR: opening %s: %s",
fname, cyrusdb_strerror(ret));
return 1;
}

free(tofree);

Expand Down

0 comments on commit 1e7cf05

Please sign in to comment.