Skip to content

Commit

Permalink
JUNK debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elliefm committed Dec 3, 2024
1 parent 89e0591 commit c2b24c2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions imap/mboxlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ static void mboxlist_dbname_to_key(const char *dbname, size_t len,
buf_putc(key, KEY_TYPE_NAME);

if (userid) {
syslog(LOG_DEBUG, "%s: dbname=<%.*s> len=<" SIZE_T_FMT "> userid=<%s>\n",
__func__, (int) len, dbname, len, userid);
mbname_t *mbname = mbname_from_userid(userid);
char *inbox = mbname_dbname(mbname);
size_t inboxlen = strlen(inbox);
Expand All @@ -392,13 +394,19 @@ static void mboxlist_dbname_to_key(const char *dbname, size_t len,
}

buf_appendmap(key, dbname, len);
if (userid)
syslog(LOG_DEBUG, "%s: => key=<%s>", __func__, buf_cstring(key));
}

static void mboxlist_dbname_from_key(const char *key, size_t len,
const char *userid, struct buf *dbname)
{
assert(key[0] == KEY_TYPE_NAME);

if (userid)
syslog(LOG_DEBUG, "%s: key=<%.*s> len=<" SIZE_T_FMT "> userid=<%s>",
__func__, (int) len, key, len, userid);

if (userid
&& len >= 6
&& (!key[6] || key[6] == DB_HIERSEP_CHAR)
Expand All @@ -409,13 +417,17 @@ static void mboxlist_dbname_from_key(const char *key, size_t len,

buf_setcstr(dbname, inbox);
buf_appendmap(dbname, key+6, len-6);
syslog(LOG_DEBUG, "%s: => dbname=<%s>", __func__, buf_cstring(dbname));

mbname_free(&mbname);
free(inbox);
return;
}

buf_init_ro(dbname, key+1, len-1);

if (userid)
syslog(LOG_DEBUG, "%s: => dbname=<%s>", __func__, buf_cstring(dbname));
}

static void mboxlist_id_to_key(const char *id, struct buf *key)
Expand Down

0 comments on commit c2b24c2

Please sign in to comment.