Browse Source

modules/lcr: always use current time when loading gateways

- Always use current time when deciding if a gateway is defunct or not.
  Otherwise a gateway may get used even if its defunct until time in
  database is greater than current time.
(cherry picked from commit 0c819f3ff3d947897fa0bafbaaa0081b671bb4e4)
Juha Heinanen 15 năm trước cách đây
mục cha
commit
2da81aa4f5
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      modules/lcr/lcr_mod.c

+ 2 - 3
modules/lcr/lcr_mod.c

@@ -1746,12 +1746,11 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char *_from_uri)
     gw_count = gws[0].ip_addr;
 
     if (defunct_capability > 0) {
-	now = time((time_t *)NULL);
 	delete_avp(defunct_gw_avp_type, defunct_gw_avp);
-    } else {
-	now = MAX_UVAR_VALUE(now);
     }
 
+    now = time((time_t *)NULL);
+
     while (pl) {
 	if (ruri_user.len < pl->prefix_len) {
 	    pl = pl->next;