tirpi 2009/09/10 18:20:57 CEST
SER CVS Repository
Modified files:
modules/tm h_table.c
Log:
tm: minor mem leak corrected
(backport from git)
After the memory of a cell is allocated other modules
immediately have a chance to register transaction callbacks,
and they may also allocate additional memory for
the callback parameters. When sip_msg_cloner()
failed, the memory allocated for the callback
list was not freed. This happend only when the available
shm memory was already very low which caused sip_msg_cloner()
to fail.
Revision Changes Path
1.114 +17 -1 sip_router/modules/tm/h_table.c
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/tm/h_table…
Module: sip-router
Branch: master
Commit: 05af490239a5556704999d613e140e25425b0888
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=05af490…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Thu Sep 10 17:50:57 2009 +0200
tm: minor mem leak corrected
After the memory of a cell is allocated other modules
immediately have a chance to register transaction callbacks,
and they may also allocate additional memory for
the callback parameters. When sip_msg_cloner()
failed, the memory allocated for the callback
list was not freed. This happend only when the available
shm memory was already very low which caused sip_msg_cloner()
to fail.
---
modules/tm/h_table.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
index 11fb1a8..f72737e 100644
--- a/modules/tm/h_table.c
+++ b/modules/tm/h_table.c
@@ -266,6 +266,7 @@ struct cell* build_cell( struct sip_msg* p_msg )
struct cell* new_cell;
int sip_msg_len;
avp_list_t* old;
+ struct tm_callback *cbs, *cbs_tmp;
/* allocs a new cell */
/* if syn_branch==0 add space for md5 (MD5_LEN -sizeof(struct cell.md5)) */
@@ -343,6 +344,21 @@ struct cell* build_cell( struct sip_msg* p_msg )
return new_cell;
error:
+ /* Other modules may have already registered some
+ * transaction callbacks and may also allocated
+ * additional memory for their parameters,
+ * hence TMCB_DESTROY needs to be called. (Miklos)
+ */
+ if (unlikely(has_tran_tmcbs(new_cell, TMCB_DESTROY)))
+ run_trans_callbacks(TMCB_DESTROY, new_cell, 0, 0, 0);
+
+ /* free the callback list */
+ for( cbs=(struct tm_callback*)new_cell->tmcb_hl.first ; cbs ; ) {
+ cbs_tmp = cbs;
+ cbs = cbs->next;
+ shm_free_unsafe( cbs_tmp );
+ }
+
destroy_avp_list(&new_cell->user_avps_from);
destroy_avp_list(&new_cell->user_avps_to);
destroy_avp_list(&new_cell->uri_avps_from);
Module: sip-router
Branch: master
Commit: 0e24d9be231fc54e13fd069ae28cc050cc708664
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0e24d9b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Sep 10 16:22:08 2009 +0200
textops(k): new function - msg_apply_changes()
- apply changes done to SIP request content (e.g., via subst(),
append_hf(), remove_hf(), etc.)
- after using this function, the content of SIP message buffer is
updated and the initially recevied content is lost
- function can be used in request route blocks
- be careful when used since:
- it changes the way you're used so far
- not much tested with various modules
---
modules_k/textops/README | 506 +++++++++++++++++++------------
modules_k/textops/doc/textops_admin.xml | 32 ++
modules_k/textops/textops.c | 83 +++++-
3 files changed, 420 insertions(+), 201 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=0e2…
daniel,
i tried imc module, but got into problems, because i'm not able to
specify any extra headers the messages send by imc server.
it is ok if i try to add extra_hdrs param to imc module like msilo
module has?
-- juha
3.5. extra_hdrs (string)
Extra headers (each ending with \r\n) to be added in messages sent from
silo by m_dump. It can contain pseudo-variables
The snmpstats module has a few MIBS included that is based on the
entrprise number 27483.
OpenSIPS.org has changed the registration for this and now maintains
that enterprise number. This might lead to two different mibs with the
same OID, which is not a good solution.
Before release, I suggest we get a new assigned enterprise number from
IANA for the project and change the MIBS and the snmpstats module.
Using the same as OpenSIPS is not a good solution.
http://www.iana.org/assignments/enterprise-numbers says:
27483 OpenSIPS.ORG (previous was 'OpenSER.ORG') Bogdan-Andrei Iancu
bogdan.iancu&voice-system.ro
/O
Hello,
who ever has brand new features to push into upcoming Kamailio 3.0 has
to do it this week. The plan is o freeze the code and start the testing
phase at the beginning of next week, with bug hunting as main activity.
As usual, work on additional tools and documentation can go on during
testing. If discovered, important missing features from kamailio 1.5
will be considered bugs.
Cheers,
Daniel
--
Daniel-Constantin Mierla
* http://www.asipto.com/