[asterisk-bugs] [Asterisk 0012541]: [patch] Janitor for getvar_helper threadsafe

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Apr 28 17:40:45 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12541 
====================================================================== 
Reported By:                snuffy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12541
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 114714 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-28-2008 10:01 CDT
Last Modified:              04-28-2008 17:40 CDT
====================================================================== 
Summary:                    [patch] Janitor for getvar_helper threadsafe
Description: 
I've done a few patches following the code outlined in the
janitor-projects.txt document.
Most apps have been done aside from app_dial at the moment.
All still compiled/ran after change no other testing has taken place.

Note for some multiple get of vars i hold lock for the 3 or so variables
then unlock.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 04-28-08 17:40  
---------------------------------------------------------------------- 
I wouldn't say they need to be scrapped, but where it makes sense, fix the
problems, instead of pasting simplistic code.  The two main cases I see
are:
cases where the value is immediately scanned into another variable, like
scanning an integer (as is the case in app_morsecode) or where the value is
immediately copied into another buffer (as is the case in app_stack). 
Neither of these requires scrapping the patch, only in re-reading the
patched version and making some very simple changes, to remove unnecessary
operations.

The only time you really need to ast_strdupa() the variable is if the use
of that variable is relatively long-term.  If the use is just very quick,
then extending the time period that the channel is locked is enough. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-28-08 17:40  Corydon76      Note Added: 0086114                          
======================================================================




More information about the asterisk-bugs mailing list