浏览代码

htable: check for expired records only for tables with auto-expire set

- from a patch by Krishna Kurapati
Elena-Ramona Modroiu 13 年之前
父节点
当前提交
1f5b0632e0
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      modules_k/htable/ht_db.c

+ 6 - 4
modules_k/htable/ht_db.c

@@ -369,10 +369,12 @@ int ht_db_save_table(ht_t *ht, str *dbtable)
 					it->name.len, it->name.s, it->value.n);
 					it->name.len, it->name.s, it->value.n);
 			}
 			}
 
 
-			if (it->expire <= now) {
-				LM_DBG("skipping expired entry");
-				it = it->next;
-				continue;
+			if(ht->htexpire > 0) {
+				if (it->expire <= now) {
+					LM_DBG("skipping expired entry");
+					it = it->next;
+					continue;
+				}
 			}
 			}
 
 
 			db_vals[0].type = DB1_STR;
 			db_vals[0].type = DB1_STR;