<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] 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
- [x ] Small bug fix (non-breaking change which fixes an issue)
- [ ] 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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Just small notes on $http_req(timeout) usage.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1913
-- Commit Summary --
* Notes on use http_req(timeout)
* Typo
* Fix README
-- File Changes --
M src/modules/http_async_client/doc/http_async_client_admin.xml (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1913.patchhttps://github.com/kamailio/kamailio/pull/1913.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/1913
Module: kamailio
Branch: master
Commit: 278fd5a892c14f23e9f2b8d1f3fd3232c1d319f3
URL: https://github.com/kamailio/kamailio/commit/278fd5a892c14f23e9f2b8d1f3fd323…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-03-29T10:15:17+01:00
tcpops: set tcp keepalive values when available per option
- cover macos and *bsd for couple of options
---
Modified: src/modules/tcpops/tcpops.c
---
Diff: https://github.com/kamailio/kamailio/commit/278fd5a892c14f23e9f2b8d1f3fd323…
Patch: https://github.com/kamailio/kamailio/commit/278fd5a892c14f23e9f2b8d1f3fd323…
---
diff --git a/src/modules/tcpops/tcpops.c b/src/modules/tcpops/tcpops.c
index 9abf34af6e..3f66958b6c 100644
--- a/src/modules/tcpops/tcpops.c
+++ b/src/modules/tcpops/tcpops.c
@@ -130,8 +130,13 @@ int tcpops_acquire_fd_from_tcpmain(int conid, int *fd)
return 0;
}
-#if !defined(HAVE_SO_KEEPALIVE) || !defined(HAVE_TCP_KEEPIDLE) || !defined(HAVE_TCP_KEEPCNT) || !defined(HAVE_TCP_KEEPINTVL)
- #warning "TCP keepalive is not fully supported by your platform"
+#if !defined(HAVE_SO_KEEPALIVE) || !defined(HAVE_TCP_KEEPCNT) || !defined(HAVE_TCP_KEEPINTVL)
+ #define KSR_TCPOPS_NOKEEPALIVE
+#endif
+
+#ifdef KSR_TCPOPS_NOKEEPALIVE
+
+#warning "TCP keepalive options not supported by this platform"
int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
{
@@ -144,6 +149,7 @@ int tcpops_keepalive_disable(int fd, int closefd)
LM_ERR("tcp_keepalive_disable() failed: this module does not support your platform\n");
return -1;
}
+
#else
int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
@@ -156,11 +162,15 @@ int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int close
LM_ERR("failed to enable SO_KEEPALIVE: %s\n", strerror(errno));
return -1;
} else {
-
+#ifdef HAVE_TCP_KEEPIDLE
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &idle,
sizeof(idle))<0){
LM_ERR("failed to set keepalive idle interval: %s\n", strerror(errno));
}
+#else
+ #warning "TCP_KEEPIDLE option not supported by this platform"
+ LM_DBG("TCP_KEEPIDLE option not available - ignoring\n");
+#endif
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &count,
sizeof(count))<0){
Module: kamailio
Branch: master
Commit: c3632f5d37e3d1ecc9232491c0ec18ccca24f612
URL: https://github.com/kamailio/kamailio/commit/c3632f5d37e3d1ecc9232491c0ec18c…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-03-29T10:15:17+01:00
modules: readme files regenerated - http_async_client ... [skip ci]
---
Modified: src/modules/http_async_client/README
---
Diff: https://github.com/kamailio/kamailio/commit/c3632f5d37e3d1ecc9232491c0ec18c…
Patch: https://github.com/kamailio/kamailio/commit/c3632f5d37e3d1ecc9232491c0ec18c…
---
diff --git a/src/modules/http_async_client/README b/src/modules/http_async_client/README
index 1f4540b69e..f2afe6325d 100644
--- a/src/modules/http_async_client/README
+++ b/src/modules/http_async_client/README
@@ -425,7 +425,9 @@ xlog("L_INFO", "received reply for query $http_req_id\n");
* method: sets the HTTP method: either "GET", "POST", "PUT" or
"DELETE" (these are the supported methods). (Note: if the method is
not set, curl will use GET, or POST if a body is specified)
- * timeout: sets the HTTP timeout
+ * timeout: sets the HTTP timeout. (Note, this timeout should be
+ normally less than tm.fr_timer timeout, because transaction timeout
+ has a higher priority over HTTP timeout)
* tls_client_cert: sets the client certificate to use
* tls_client_key: sets the client certificate key to use
* tls_ca_path: sets the CA certificate path to use