Browse Source

ims_charging: removed session unlock function call when no lock was acquired

Carlos Ruiz Diaz 12 years ago
parent
commit
2dc78738af
3 changed files with 12 additions and 9 deletions
  1. 1 1
      modules/ims_charging/dialog.c
  2. 7 6
      modules/ims_charging/ims_ro.c
  3. 4 2
      modules/ims_charging/ro_timer.c

+ 1 - 1
modules/ims_charging/dialog.c

@@ -80,7 +80,7 @@ void dlg_reply(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) {
 //		ro_session_unlock(ro_session_table, ro_session_entry);
 
 		cdpb.AAAStartChargingCCAccSession(cdp_session);
-		cdpb.AAASessionsUnlock(cdp_session->hash);		
+//		cdpb.AAASessionsUnlock(cdp_session->hash);		
 		
 //		unref_ro_session(session, 1);	DONT need this anymore because we don't do lookup so no addition to ref counter
 	}

+ 7 - 6
modules/ims_charging/ims_ro.c

@@ -698,8 +698,8 @@ error:
 	if (ro_cca_data)
 		Ro_free_CCA(ro_cca_data);
 
-	if (ro_cca_data)
-		cdpb.AAAFreeMessage(&cca);
+//	if (ro_cca_data)
+	cdpb.AAAFreeMessage(&cca);
 
 	if (i_req) {
 		i_req->credit_valid_for = 0;
@@ -861,15 +861,14 @@ static void resume_on_termination_ccr(int is_timeout, void *param, AAAMessage *c
     	LM_DBG("Valid CCA response for STOP record\n");
     }
 
-    Ro_free_CCA(ro_cca_data);
-    cdpb.AAAFreeMessage(&cca);
+//   Ro_free_CCA(ro_cca_data);
+//   cdpb.AAAFreeMessage(&cca);
 
     update_stat(successful_final_ccrs, 1);
 
-    return;
-
 error:
 	Ro_free_CCA(ro_cca_data);
+    cdpb.AAAFreeMessage(&cca);
 }
 
 
@@ -1112,6 +1111,8 @@ error0:
     LM_DBG("Trying to reserve credit on initial INVITE failed on cdp callback\n");
     create_cca_return_code(error_code);
 
+    cdpb.AAAFreeMessage(&cca);
+
     if (t)
     	tmb.unref_cell(t);
 

+ 4 - 2
modules/ims_charging/ro_timer.c

@@ -363,10 +363,12 @@ void ro_session_ontimeout(struct ro_tl *tl) {
 		LM_ERR("Can't find a session. This is bad");
 		return;
 	}
-	
+
+//	LM_ALERT("LOCKING... ");	
 	ro_session_entry = &(ro_session_table->entries[ro_session->h_entry]);
 	ro_session_lock(ro_session_table, ro_session_entry);
-
+//	LM_ALERT("LOCKED!");
+	
 	LM_DBG("event-type=%d", ro_session->event_type);
 
 	switch (ro_session->event_type) {