فهرست منبع

modules/ims_usrloc_scscf: added missing db_mode check

Jason Penton 10 سال پیش
والد
کامیت
723540b24b
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      modules/ims_usrloc_scscf/ucontact.c

+ 2 - 1
modules/ims_usrloc_scscf/ucontact.c

@@ -69,6 +69,7 @@
 #include "contact_hslot.h"
 
 extern struct contact_list* contact_list;
+extern int db_mode;
 
 /*!
  * \brief Create a new contact structure
@@ -383,7 +384,7 @@ int update_ucontact(struct impurecord* _r, ucontact_t* _c, ucontact_info_t* _ci)
         return -1;
     }
     
-    if (db_insert_ucontact(_r, _c) != 0) {  /* this is an insert/update */
+    if (db_mode == WRITE_THROUGH && (db_insert_ucontact(_r, _c) != 0)) {  /* this is an insert/update */
 	LM_ERR("failed to update contact in DB [%.*s]\n", _c->aor.len, _c->aor.s);
 	return -1;
     }