[sr-dev] git:master: modules_k/dialog: Simplify and refactor parts of reference counter

Timo Reimann timo.reimann at 1und1.de
Fri Aug 26 21:54:33 CEST 2011


Module: sip-router
Branch: master
Commit: f44534cbe841046079e176512b04a6b9c5a68bdc
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f44534cbe841046079e176512b04a6b9c5a68bdc

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Thu Aug 25 15:17:48 2011 +0200

modules_k/dialog: Simplify and refactor parts of reference counter
handling.

- Remove special handling for dialogs in the "deleted" state to
  allow accessing such dialogs (e.g., from the configuration
  script).
  Besides making the code easier to understand, this also fixes a
  bug where the reference counter would be decremented after
  detecting a spiral (dlg_handlers.c) even though get_dlg() does
  not increment it for "deleted" dialogs.
- Adapt interfaces for lookup_dlg() and get_dlg() accordingly,
  i.e., remove "del" parameter and update in-code documentation.
- Replace direct increments on a dialog structure's ref variable
  by calls to ref_dlg_unsafe().
- Move {un}ref_dlg_unsafe() definitions towards the head of the
  file to make declaration available earlier.
- Improve store_dlg_in_tm():
    * Return and evaluate result code.
    * Replace second register call by passing unreference_dialog()
      as release function to the first register call.
- Document various places in the code dealing with reference
  counting.

---

 modules_k/dialog/dialog.c         |    5 +-
 modules_k/dialog/dlg_handlers.c   |   92 +++++++------------------
 modules_k/dialog/dlg_hash.c       |  139 +++++++++++++++---------------------
 modules_k/dialog/dlg_hash.h       |   13 ++--
 modules_k/dialog/dlg_profile.c    |    3 +
 modules_k/dialog/dlg_req_within.c |    2 +-
 6 files changed, 97 insertions(+), 157 deletions(-)

Diff:   http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=f44534cbe841046079e176512b04a6b9c5a68bdc



More information about the sr-dev mailing list