asterisk/include/asterisk
Russell Bryant 92bd7f19f7 Merge team/russell/ast_verbose_threadstorage
- instead of defining a free() wrapper in a bunch of files, define it as
  ast_free() in utils.h and remove the copies from all the files.

- centralize and abstract the code used for doing thread storage. The code
  lives in threadstorage.h, with one function being implemented in utils.c.
  This new API includes generic thread storage as well as special functions
  for handling thread local dynamic length string buffers.

- update ast_inet_ntoa() to use the new threadstorage API
- update ast_state2str() to use the new threadstorage API
- update ast_cli() to use the new threadstorage API

- Modify manager_event() to use thread storage. Instead of using a buffer of
  4096 characters as the workspace for building the manager event, use a thread
  local dynamic string.  Now there is no length limitation on the length of the
  body of a manager event.

- Significantly simplify the handling of ast_verbose() ...
  - Instead of using a static char buffer and a lock to make sure only one
    thread can be using ast_verbose() at a time, use a thread local dynamic
    string as the workspace for preparing the verbose message. Instead of
    locking around the entire function, the only locking done now is when the
    message has been built and is being deliviered to the list of registered
    verbose message handlers.
  - This function was doing a strdup() on every message passed to it and
    keeping a queue of the last 200 messages in memory. This has been
    completely removed. The only place this was used was that if there were
    any messages in the verbose queue when a verbose handler was registered,
    all of the messages in the queue would be fed to it.  So, I just made sure
    that the console verbose handler and the network verbose handler (for
    remote asterisk consoles) were registered before any verbose messages.
    pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at
    startup, but I didn't feel the performance hit of this message queue was
    worth saving the initial verbose output for these very rarely used modules.
  - I have removed the last three arguments to the verbose handlers, leaving
    only the string itself because they aren't needed anymore. For example,
    ast_verbose had some logic for telling the verbose handler to add
    a newline if the buffer was completely full. Now that the buffer can grow
    as needed, this doesn't matter anymore.
  - remove unused function, ast_verbose_dmesg() which was to dispatch the
    message queue
  - Convert the list of verbose handlers to use the linked list macros.

- add missing newline characters to a few ast_verbose() calls

- convert the list of log channels to use the linked list macros in logger.c

- fix close_logger() to close all of the files it opened for logging

- update ast_log() to use a thread local dynamic string for its workspace
  for preparing log messages instead of a buffer of size BUFSIZ (8kB on my
  system) allocated on the stack.  The dynamic string in this case is limited
  to only growing to a maximum size of BUFSIZ.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08 06:32:04 +00:00
..
abstract_jb.h Fix a few doxygen warnings. 2006-07-19 22:40:36 +00:00
acl.h improve IP TOS support for SIP and IAX2 (issue #6355, code from jcollie plus modifications) 2006-03-28 03:28:52 +00:00
adsi.h constification and code simplifications 2006-04-14 22:02:19 +00:00
ael_structs.h The contents of branch teams/murf/bug_7598 are being folded in here. 2006-08-07 12:59:47 +00:00
aes.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
agi.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
alaw.h yet another massive performance and memory savings improvement 2006-06-05 18:05:53 +00:00
app.h Add details about flash and wait to doxygen about DTMF. 2006-07-30 15:02:34 +00:00
ast_expr.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
astdb.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
astmm.h fix the build with astmm enabled 2006-06-07 19:53:03 +00:00
astobj.h Commiting bugfix 5310. added functions to astobj 2006-01-08 17:24:54 +00:00
astosp.h Updates from transnexus to osplookup, removes res_osp 2006-06-30 15:12:35 +00:00
autoconfig.h.in actually do proper searching for c-client and output the results so app_voicemail can be built against it 2006-07-07 02:20:04 +00:00
callerid.h remove the WITH_SMDI define 2006-06-07 18:28:29 +00:00
causes.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
cdr.h document that ast_cdr_answer is happy with a NULL argument 2006-05-03 17:37:47 +00:00
channel.h Merge my applicationmap_fixup branch to address the issues described in this 2006-08-07 04:15:52 +00:00
chanspy.h Merged revisions 33724 via svnmerge from 2006-06-12 21:37:29 +00:00
chanvars.h Bug 5858 - Make the chanvars.c functions return a 'const char *' 2005-12-03 19:25:33 +00:00
cli.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
compat.h always include inttypes.h and sys/types.h in asterisk/compat.h to fix a build 2006-06-08 20:49:59 +00:00
compiler.h Merge team/russell/ast_verbose_threadstorage 2006-08-08 06:32:04 +00:00
config.h Allow updates to match specific lines, allow specification of object or 2006-07-29 22:02:37 +00:00
crypto.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
devicestate.h Support hold/unhold in Zap, update IAX2 parser to know about modern commands, forward hold/unhold in dial, add hold device state 2006-07-08 02:24:07 +00:00
dlfcn-compat.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
dns.h fix various pointer signedness issues 2006-07-07 06:55:48 +00:00
dnsmgr.h add an updated patch that adds dnsmgr support for outgoing iax2 registrations 2006-06-07 17:44:36 +00:00
doxyref.h Doxygen updates 2006-06-08 18:03:08 +00:00
dsp.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
dundi.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
endian.h various minor portability fixes (mostly from tholo for OpenBSD) 2006-06-09 20:26:25 +00:00
enum.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
features.h remove useless 'extern' in function declarations. 2006-03-31 00:11:45 +00:00
file.h yet another massive performance and memory savings improvement 2006-06-05 18:05:53 +00:00
frame.h move slinfactory structure definition back to header... it's just easier to use this way 2006-07-28 18:59:59 +00:00
fskmodem.h trailing whitespace/ useless extern removal 2006-03-31 15:02:52 +00:00
http.h - Doxygen additions 2006-04-03 18:38:28 +00:00
image.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
indications.h do not export the tzlock and the list head, and introduce a new method, 2006-03-30 17:10:11 +00:00
inline_api.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
io.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
jabber.h convert one of my linked lists to ast_linklist 2006-06-09 16:08:33 +00:00
jingle.h asterisk-xmpp merge in 2006-05-22 21:12:30 +00:00
linkedlists.h Merged revisions 31738 via svnmerge from 2006-06-03 14:49:52 +00:00
localtime.h more trailing whitespace and extern removal 2006-03-31 10:35:25 +00:00
lock.h fix the condition for including the header for osx atomics 2006-06-30 16:02:05 +00:00
logger.h Merge team/russell/ast_verbose_threadstorage 2006-08-08 06:32:04 +00:00
manager.h First pass at in-place file manipulation via manager 2006-07-19 13:28:38 +00:00
md5.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
module.h various doxygen fixes 2006-05-09 16:24:07 +00:00
monitor.h added feature for pausing and unpausing the 2006-01-14 00:32:30 +00:00
musiconhold.h merge Russell's 'hold_handling' branch, finally implementing music-on-hold handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be) 2006-07-19 20:44:39 +00:00
netsock.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
options.h As discussed and decided on the asterisk-dev mailing list ... 2006-07-28 19:17:56 +00:00
pbx.h Support hold/unhold in Zap, update IAX2 parser to know about modern commands, forward hold/unhold in dial, add hold device state 2006-07-08 02:24:07 +00:00
plc.h Merged revisions 34087 via svnmerge from 2006-06-14 14:12:56 +00:00
poll-compat.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
privacy.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
res_odbc.h update res_odbc to support pooled connections 2006-04-18 18:16:32 +00:00
rtp.h allow users of RTP to use G726-32 AAL2 packing even when RFC3551 packing has been requested (Sipura/Grandstream ATAs and others will need this) 2006-07-13 01:38:47 +00:00
say.h move to a different file (channel.c for the time being) the 2006-04-19 07:23:22 +00:00
sched.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
sha1.h merge rizzo's patch to make compiler warnings stop the build, and fix a bunch of warnings found 2006-02-22 22:53:49 +00:00
slinfactory.h move slinfactory structure definition back to header... it's just easier to use this way 2006-07-28 18:59:59 +00:00
smdi.h clean up SMDI support commit: 2006-02-10 23:55:47 +00:00
speech.h Expand speech API so that the developer can interact with the engine more directly and use specific functions of the connector even if a generic API call is not available 2006-07-18 16:22:26 +00:00
srv.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
stringfields.h This commit folds in changes to both stringfields (some enhancements to the ...field_set() macro, to optimize setting strings to empty, resetting strings to shorter contents, etc.) and to chan_iax2.c, to use stringfields in the user, peer, and pvt structs. Has been running stably on iaxtel, but while iaxtel has a large registration volume, it doesn't seem to have a high call volume. So far, it seems to reduce heap usage by over half. YMMV\! Please report any IAX bugs that might involve stringfields\! 2006-08-07 18:12:51 +00:00
strings.h Fixed. Done. Good. Make ast_join work like it used to. 2006-07-10 19:58:33 +00:00
tdd.h trailing whitespace/ useless extern removal 2006-03-31 15:02:52 +00:00
term.h removal of trailing whitespace and useless 'extern' 2006-03-31 10:29:50 +00:00
threadstorage.h Merge team/russell/ast_verbose_threadstorage 2006-08-08 06:32:04 +00:00
time.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
transcap.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
translate.h The Eurostar Commit! (it's amazing how much work you can get done on a 150 minute train ride from Paris to London <G>) 2006-06-24 19:43:31 +00:00
udptl.h Merged revisions 34087 via svnmerge from 2006-06-14 14:12:56 +00:00
ulaw.h yet another massive performance and memory savings improvement 2006-06-05 18:05:53 +00:00
unaligned.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
utils.h Merge team/russell/ast_verbose_threadstorage 2006-08-08 06:32:04 +00:00