Przeglądaj źródła

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

- from a patch by Krishna Kurapati
Elena-Ramona Modroiu 13 lat temu
rodzic
commit
1f5b0632e0
1 zmienionych plików z 6 dodań i 4 usunięć
  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);
 			}
 
-			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;