浏览代码

modules_k/pua: Fixed bugs with expiry value in update_(dialog|record)_puadb()

- I forgot to add (int) time(NULL) to the expiry value before updating the DB
Peter Dunkley 13 年之前
父节点
当前提交
7339273c4e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules_k/pua/pua_db.c

+ 2 - 2
modules_k/pua/pua_db.c

@@ -950,7 +950,7 @@ int update_record_puadb(ua_pres_t *pres, int expires, str *etag)
 	u_cols[n_update_cols] = &str_expires_col;
 	u_vals[n_update_cols].type = DB1_INT;
 	u_vals[n_update_cols].nul = 0;
-	u_vals[n_update_cols].val.int_val = expires;
+	u_vals[n_update_cols].val.int_val = expires + (int) time(NULL);
 	n_update_cols++;
 
 	if (etag)
@@ -1327,7 +1327,7 @@ int update_dialog_puadb(ua_pres_t *pres, int expires, str *contact)
 	u_cols[n_update_cols] = &str_expires_col;
 	u_vals[n_update_cols].type = DB1_INT;
 	u_vals[n_update_cols].nul = 0;
-	u_vals[n_update_cols].val.int_val = expires;
+	u_vals[n_update_cols].val.int_val = expires + (int) time(NULL);
 	n_update_cols++;
 
 	u_cols[n_update_cols] = &str_cseq_col;