Module: sip-router
Branch: 3.3
Commit: 5f8405f577d66069fde48202862f06cac432139b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5f8405f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jul 18 19:00:38 2012 +0200
tls: set function to return the id
- starting with v1.0.0 openssl does not use anymore getpid(), but address
of errno which can point to same virtual address in a multi-process
application
- for refrence http://www.openssl.org/docs/crypto/threads.html
- credits to Jijo on sr-dev mailing list
(cherry picked from commit 0615826fe602c5183fbc7be7c51de5eb5eb7223c)
---
modules/tls/tls_locking.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules/tls/tls_locking.c b/modules/tls/tls_locking.c
index 86bda17..d85b14c 100644
--- a/modules/tls/tls_locking.c
+++ b/modules/tls/tls_locking.c
@@ -130,6 +130,10 @@ void tls_destroy_locks()
}
+unsigned long sr_ssl_id_f()
+{
+ return my_pid();
+}
/* returns -1 on error, 0 on success */
int tls_init_locks()
@@ -163,10 +167,13 @@ int tls_init_locks()
CRYPTO_set_dynlock_lock_callback(dyn_lock_f);
CRYPTO_set_dynlock_destroy_callback(dyn_destroy_f);
- /* thread id callback: not needed because ser doesn't use thread and
- * openssl already uses getpid() (by default)
- * CRYPTO_set_id_callback(id_f);
+ /* starting with v1.0.0 openssl does not use anymore getpid(), but address
+ * of errno which can point to same virtual address in a multi-process
+ * application
+ * - for refrence http://www.openssl.org/docs/crypto/threads.html
*/
+ CRYPTO_set_id_callback(sr_ssl_id_f);
+
/* atomic add -- since for now we don't have atomic_add
* (only atomic_inc), fallback to the default use-locks mode
* CRYPTO_set_add_lock_callback(atomic_add_f);
Module: sip-router
Branch: 3.3
Commit: 81149e30785aa1cc6f04e130afafb643d9163cce
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=81149e3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Jun 25 10:36:31 2012 +0200
dispatcher(k): allow set id 0 for OPTIONS callback
- set id is provided in param pointer address, 0 being equivalent to
NULL
- reported by Avi Brender
(cherry picked from commit 2664cb9aa8ffd5d26ef6a0841318ccbcdefbf69b)
---
modules_k/dispatcher/dispatch.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules_k/dispatcher/dispatch.c b/modules_k/dispatcher/dispatch.c
index a60401c..7429e97 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -2326,9 +2326,9 @@ static void ds_options_callback( struct cell *t, int type,
sip_msg_t *fmsg;
int state;
- /* The Param does contain the group, in which the failed host
+ /* The param contains the group, in which the failed host
* can be found.*/
- if (!*ps->param)
+ if (ps->param==NULL)
{
LM_DBG("No parameter provided, OPTIONS-Request was finished"
" with code %d\n", ps->code);