hash = core_hash(dbn, tbn, DBCASSA_TABLE_SIZE);
if(!hash)
LM_ERR("hash NOT FOUND\n");
hashidx = hash % DBCASSA_TABLE_SIZE;
if(!hashidx)
LM_ERR("hashidx NOT FOUND\n");
ref_read_data(dbcassa_tbl_htable[hashidx].lock);
tbc = dbcassa_tbl_htable[hashidx].dtp;
if(!tbc)
LM_ERR("TBC NOT FOUND\n");
while(tbc) {
LM_DBG("found dbname=%.*s, table=%.*s\n", tbc->dbname.len, tbc->dbname.s, tbc->name.len, tbc->name.s);
if(tbc->hash==hash && tbc->dbname.len == dbn->len
&& tbc->name.len == tbn->len
&& !strncasecmp(tbc->dbname.s, dbn->s, dbn->len)
&& !strncasecmp(tbc->name.s, tbn->s, tbn->len)) {
memcpy(full_path_buf + dbcassa_schema_path.len, dbn->s, dbn->len);
len = dbcassa_schema_path.len + dbn->len;
full_path_buf[len++] = '/';
memcpy(full_path_buf + len, tbn->s, tbn->len);
full_path_buf[len + tbn->len] = '\0';
if(dbcassa_check_mtime(&tbc->mt) == 0)
return tbc;
old_tbc = tbc;
break;
}
tbc = tbc->next;
}
unref_read_data(dbcassa_tbl_htable[hashidx].lock);
if(!old_tbc) {
LM_ERR("OLD_TBC NOT FOUND\n");
return NULL;
}