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

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Sep 7 08:49:24 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10666 
====================================================================== 
Reported By:                arkadia
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10666
Category:                   CDR/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-07-2007 05:22 CDT
Last Modified:              09-07-2007 08:49 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.
====================================================================== 

---------------------------------------------------------------------- 
 arkadia - 09-07-07 08:49  
---------------------------------------------------------------------- 
Corydon76: thats right. 
I've tested this patch against trunk and it clearly applies with 
"offset -2 lines". So I assume there is no requirements on uploading new
patch for now. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-07-07 08:49  arkadia        Note Added: 0070096                          
======================================================================




More information about the asterisk-bugs mailing list