if (cdb_bucket != NULL) {
ftc_num_msgs[tok] = cdb_bucket->len / sizeof(long);
ftc_msgs[tok] = (long *)cdb_bucket->ptr;
- cdb_bucket->ptr = NULL;
+ cdb_bucket->ptr = NULL; // (this needs attention if we move to LMDB)
cdb_free(cdb_bucket);
}
else {
if (cdb_bucket != NULL) {
ftc_num_msgs[tok] = cdb_bucket->len / sizeof(long);
ftc_msgs[tok] = (long *)cdb_bucket->ptr;
- cdb_bucket->ptr = NULL;
+ cdb_bucket->ptr = NULL; // (this needs attention if we move to LMDB)
cdb_free(cdb_bucket);
}
else {
Imap->msgids = (long*)cdbfr->ptr;
Imap->num_msgs = cdbfr->len / sizeof(long);
Imap->num_alloc = cdbfr->len / sizeof(long);
- cdbfr->ptr = NULL;
+ cdbfr->ptr = NULL; // (this needs attention if we move to LMDB)
cdbfr->len = 0;
cdb_free(cdbfr);
}
cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
if (cdbfr != NULL) {
msglist = (long*)cdbfr->ptr;
- cdbfr->ptr = NULL;
+ cdbfr->ptr = NULL; // (this needs attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
cdbfr->len = 0;
cdb_free(cdbfr);
cdbfr = cdb_fetch(CDB_MSGLISTS, &which_room->QRnumber, sizeof(long));
if (cdbfr != NULL) {
msglist = (long *) cdbfr->ptr;
- cdbfr->ptr = NULL; // CtdlSetSeen() now owns this memory
+ cdbfr->ptr = NULL; // CtdlSetSeen() now owns this memory (this needs attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
}
if (cdbfr == NULL) {
msglist = NULL;
num_msgs = 0;
- } else {
+ }
+ else {
msglist = (long *) cdbfr->ptr;
- cdbfr->ptr = NULL; /* CtdlSaveMsgPointerInRoom() now owns this memory */
+ cdbfr->ptr = NULL; // CtdlSaveMsgPointerInRoom() now owns this memory (this needs attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
}
if (cdbfr != NULL) {
dellist = malloc(cdbfr->len);
msglist = (long *) cdbfr->ptr;
- cdbfr->ptr = NULL; /* CtdlDeleteMessages() now owns this memory */
+ cdbfr->ptr = NULL; // CtdlDeleteMessages() now owns this memory (this needs attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
}
int have_more_del = 1;
num_msgs = sort_msglist(msglist, num_msgs);
- if (num_dmsgnums > 1)
+ if (num_dmsgnums > 1) {
num_dmsgnums = sort_msglist(dmsgnums, num_dmsgnums);
-/*
- {
- StrBuf *dbg = NewStrBuf();
- for (i = 0; i < num_dmsgnums; i++)
- StrBufAppendPrintf(dbg, ", %ld", dmsgnums[i]);
- syslog(LOG_DEBUG, "msgbase: Deleting before: %s", ChrPtr(dbg));
- FreeStrBuf(&dbg);
}
-*/
- i = 0; j = 0;
+ i = 0;
+ j = 0;
while ((i < num_msgs) && (have_more_del)) {
delete_this = 0x00;
cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
if (cdbfr != NULL) {
msglist = (long *) cdbfr->ptr;
- cdbfr->ptr = NULL; // CtdlUserGoto() now owns this memory
+ cdbfr->ptr = NULL; // CtdlUserGoto() now owns this memory (this requires attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
}