Module: kamailio
Branch: master
Commit: 6a637cf84906ec5315c77e5458180f7d9d69a481
URL: https://github.com/kamailio/kamailio/commit/6a637cf84906ec5315c77e5458180f7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-07-03T23:00:24+02:00
core: tcp - test connection reference counter to avoid going negative
---
Modified: src/core/tcp_main.c
---
Diff: https://github.com/kamailio/kamailio/commit/6a637cf84906ec5315c77e5458180f7…
Patch: https://github.com/kamailio/kamailio/commit/6a637cf84906ec5315c77e5458180f7…
---
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index fd5a644ee5..f19f75a588 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -3263,7 +3263,8 @@ inline static int tcpconn_put_destroy(struct tcp_connection* tcpconn)
* the refcnt. and at least a membar_write_atomic_op() mem. barrier or
* a mb_atomic_* op must * be used to make sure all the changed flags are
* written into memory prior to the new refcnt value */
- if (unlikely(mb_atomic_dec_and_test(&tcpconn->refcnt))){
+ if (unlikely((mb_atomic_get(&tcpconn->refcnt)==0)
+ || mb_atomic_dec_and_test(&tcpconn->refcnt))){
_tcpconn_free(tcpconn);
return 1;
}
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #2308
#### Description
add support for trimming an already existing alias parameter when calling `set_contact_alias()`
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2388
-- Commit Summary --
* nathelper: add optional set_contact_alias([trim]) parameter
-- File Changes --
M src/core/dset.c (85)
M src/core/dset.h (1)
M src/modules/nathelper/doc/nathelper_admin.xml (12)
M src/modules/nathelper/nathelper.c (37)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2388.patchhttps://github.com/kamailio/kamailio/pull/2388.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2388
Module: kamailio
Branch: master
Commit: 9322a98cd451fa470c8ff93f85758f41c4fc6bce
URL: https://github.com/kamailio/kamailio/commit/9322a98cd451fa470c8ff93f85758f4…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-07-03T19:31:10+02:00
modules: readme files regenerated - nathelper ... [skip ci]
---
Modified: src/modules/nathelper/README
---
Diff: https://github.com/kamailio/kamailio/commit/9322a98cd451fa470c8ff93f85758f4…
Patch: https://github.com/kamailio/kamailio/commit/9322a98cd451fa470c8ff93f85758f4…
---
diff --git a/src/modules/nathelper/README b/src/modules/nathelper/README
index 7398c702a5..4cfe36880b 100644
--- a/src/modules/nathelper/README
+++ b/src/modules/nathelper/README
@@ -67,7 +67,7 @@ Ovidiu Sas
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias([trim])
+ 5.9. set_contact_alias()
5.10. set_alias_to_pv(target_avp)
6. Exported Pseudo Variables
@@ -158,7 +158,7 @@ Chapter 1. Admin Guide
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias([trim])
+ 5.9. set_contact_alias()
5.10. set_alias_to_pv(target_avp)
6. Exported Pseudo Variables
@@ -498,7 +498,7 @@ modparam("nathelper", "nat_addr_mode", 0)
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias([trim])
+ 5.9. set_contact_alias()
5.10. set_alias_to_pv(target_avp)
5.1. fix_nated_contact()
@@ -700,19 +700,13 @@ if(is_rfc1918("$rd")) {
};
...
-5.9. set_contact_alias([trim])
+5.9. set_contact_alias()
Adds an “;alias=ip~port~transport” parameter to the contact URI
containing the received ip, port, and transport protocol. The new
contact URI is immediately visible to other modules in the way the
fix_nated_contact() does it.
- Meaning of parameters:
- * trim - by default, set_contact_alias() will not detect and trim an
- already existing alias parameter. If this optional parameter is set
- to "1", set_contact_alias() will trim the existing alias before
- adding a new one.
-
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
BRANCH_ROUTE, and FAILURE_ROUTE.
Module: kamailio
Branch: master
Commit: 339b94ce713b2a3d3763d2c15c8d1437362f648e
URL: https://github.com/kamailio/kamailio/commit/339b94ce713b2a3d3763d2c15c8d143…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-07-03T16:46:13+02:00
modules: readme files regenerated - nathelper ... [skip ci]
---
Modified: src/modules/nathelper/README
---
Diff: https://github.com/kamailio/kamailio/commit/339b94ce713b2a3d3763d2c15c8d143…
Patch: https://github.com/kamailio/kamailio/commit/339b94ce713b2a3d3763d2c15c8d143…
---
diff --git a/src/modules/nathelper/README b/src/modules/nathelper/README
index 4cfe36880b..7398c702a5 100644
--- a/src/modules/nathelper/README
+++ b/src/modules/nathelper/README
@@ -67,7 +67,7 @@ Ovidiu Sas
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias()
+ 5.9. set_contact_alias([trim])
5.10. set_alias_to_pv(target_avp)
6. Exported Pseudo Variables
@@ -158,7 +158,7 @@ Chapter 1. Admin Guide
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias()
+ 5.9. set_contact_alias([trim])
5.10. set_alias_to_pv(target_avp)
6. Exported Pseudo Variables
@@ -498,7 +498,7 @@ modparam("nathelper", "nat_addr_mode", 0)
5.6. is_rfc1918(ip_address)
5.7. add_contact_alias([ip_addr, port, proto])
5.8. handle_ruri_alias()
- 5.9. set_contact_alias()
+ 5.9. set_contact_alias([trim])
5.10. set_alias_to_pv(target_avp)
5.1. fix_nated_contact()
@@ -700,13 +700,19 @@ if(is_rfc1918("$rd")) {
};
...
-5.9. set_contact_alias()
+5.9. set_contact_alias([trim])
Adds an “;alias=ip~port~transport” parameter to the contact URI
containing the received ip, port, and transport protocol. The new
contact URI is immediately visible to other modules in the way the
fix_nated_contact() does it.
+ Meaning of parameters:
+ * trim - by default, set_contact_alias() will not detect and trim an
+ already existing alias parameter. If this optional parameter is set
+ to "1", set_contact_alias() will trim the existing alias before
+ adding a new one.
+
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
BRANCH_ROUTE, and FAILURE_ROUTE.