[asterisk-bugs] [Asterisk 0010666]: not optimal CDR lock flag check

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Sep 11 10:16:13 CDT 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10666 
====================================================================== 
Reported By:                arkadia
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   10666
Category:                   CDR/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-07-2007 05:22 CDT
Last Modified:              09-11-2007 10:16 CDT
====================================================================== 
Summary:                    not optimal CDR lock flag check
Description: 
In cdr.c in functions where we check AST_CDR_FLAG_LOCKED flag
it should be done as a first thing.

Here in common patterns from the code:

for (; cdr; cdr = cdr->next) {
  if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
  .....
  }
}

OR

while (cdr) {
  if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
  .....
  }
  cdr = cdr->next;
}

Function ast_cdr_failed, ast_cdr_noanswer, ast_cdr_setdestchan should be
changed to match this idea, course they do some other stuff prior checking
AST_CDR_FLAG_LOCKED which may be not required at all.
I've prepared patch for this change.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 09-11-07 10:16  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 82248

------------------------------------------------------------------------
r82248 | file | 2007-09-11 10:16:12 -0500 (Tue, 11 Sep 2007) | 6 lines

(closes issue http://bugs.digium.com/view.php?id=10666)
Reported by: arkadia
Patches:
      cdr_lockorder.patch uploaded by arkadia (license 233)
Optimize CDR stuff a bit.

------------------------------------------------------------------------ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-11-07 10:16  svnbot         Checkin                                      
09-11-07 10:16  svnbot         Note Added: 0070326                          
09-11-07 10:16  svnbot         Status                   new => assigned     
09-11-07 10:16  svnbot         Assigned To               => file            
======================================================================




More information about the asterisk-bugs mailing list