THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#183 - tls module error on initialization when used together with the dialog module
User who did this - Øyvind Kolbu (kolbu)
----------
Thanks! I can now use enable_tls and db_posgres at the same time, not attempted
to use tls yet.
Verified to at least build and run on both origin and 3.2.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=183#comment461
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#183 - tls module error on initialization when used together with the dialog module
User who did this - Daniel-Constantin Mierla (miconda)
----------
shm was not initialized at that moment, edit modules/tls/tls_moc.c:
- include the file:
#include "../../shm_init.h"
- and replace existing mod_register function with:
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
if(!shm_initialized() && init_shm()<0)
return -1;
if(tls_pre_init()<0)
return -1;
return 0;
}
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=183#comment460
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#183 - tls module error on initialization when used together with the dialog module
User who did this - Øyvind Kolbu (kolbu)
----------
Tried the last patch, but Kamailio segfaults on startup:
Program terminated with signal 11, Segmentation fault.
#0 atomic_cmpxchg_int () at ../../atomic/atomic_x86.h:233
233 ATOMIC_FUNC_CMPXCHG(cmpxchg, "cmpxchgl %2, %1", int , int)
(gdb) bt
#0 atomic_cmpxchg_int () at ../../atomic/atomic_x86.h:233
#1 futex_get () at ../../futexlock.h:101
#2 _shm_malloc () at ../../mem/shm_mem.h:207
#3 lock_set_alloc () at ../../lock_alloc.h:72
#4 tls_init_locks () at tls_locking.c:145
#5 0x00fc2918 in tls_pre_init () at tls_init.c:463
#6 0x00fc58f7 in mod_register (path=0xb7ba3e90 "/nett/kamailio/current/lib/kamailio/modules/tls.so", dlflags=0xbfa77248, p1=0x0, p2=0x0) at tls_mod.c:274
#7 0x0812c8c7 in load_module (mod_path=0xb7ba3de0 "tls.so") at sr_module.c:599
#8 0x08204ba5 in yyparse () at cfg.y:1685
#9 0x080b2267 in main (argc=15, argv=0xbfa779f4) at main.c:2062
got the core available for debugging.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=183#comment459
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: 3.2
Commit: 9180356a88313a1026238fabb693efed92227600
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9180356…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Dec 2 13:05:55 2011 +0100
core/tcp: clone received message over tcp in local buffer
- receive_msg() got pointer inside tcp stream as rcv buffer, linking it to
msg->buf, but there are places where the content of msg->buf is
changed (topoh, msg_apply_changes) which can result in corruption of
tcp stream content
- added a wrapper function receive_tcp_msg() to clone the content and
have same behaviour as for udp or sctp
- reported by Hugh Waite, FS#185
(cherry picked from commit 6ebd0a6bf1cbacf73f45ff42d368f22304bff11b)
---
tcp_read.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/tcp_read.c b/tcp_read.c
index 1ba6cbb..c180301 100644
--- a/tcp_read.c
+++ b/tcp_read.c
@@ -848,6 +848,62 @@ skip:
}
+/**
+ * @brief wrapper around receive_msg() to clone the tcpbuf content
+ *
+ * When receiving over TCP, tcpbuf points inside the TCP stream buffer, but during
+ * processing of config, msg->buf content might be changed and may corrupt
+ * the content of the stream. Safer, make a clone of buf content in a local
+ * buffer and give that to receive_msg() to link to msg->buf
+ */
+int receive_tcp_msg(char* tcpbuf, unsigned int len, struct receive_info* rcv_info)
+{
+#ifdef DYN_BUF
+ char *buf = NULL;
+#else
+ static char *buf = NULL;
+ static unsigned int bsize = 0;
+#endif
+ int blen;
+
+ /* min buffer size is BUF_SIZE */
+ blen = len;
+ if(blen < BUF_SIZE)
+ blen = BUF_SIZE;
+
+#ifdef DYN_BUF
+ buf=pkg_malloc(blen+1);
+ if (buf==0) {
+ LM_ERR("could not allocate receive buffer\n");
+ return -1;
+ }
+#else
+ /* allocate buffer when needed
+ * - no buffer yet
+ * - existing buffer too small (min size is BUF_SIZE - to accomodate most
+ * of SIP messages; expected larger for HTTP/XCAP)
+ * - existing buffer too large (e.g., we got a too big message in the past,
+ * let's free it)
+ *
+ * - also, use system memory, not to eat from PKG (same as static buffer
+ * from PKG pov)
+ */
+ if(buf==NULL || bsize < blen || blen < bsize/2) {
+ if(buf!=NULL)
+ free(buf);
+ buf=malloc(blen+1);
+ if (buf==0) {
+ LM_ERR("could not allocate receive buffer\n");
+ return -1;
+ }
+ bsize = blen;
+ }
+#endif
+
+ memcpy(buf, tcpbuf, len);
+ buf[len] = '\0';
+ return receive_msg(buf, len, rcv_info);
+}
int tcp_read_req(struct tcp_connection* con, int* bytes_read, int* read_flags)
{
@@ -932,7 +988,7 @@ again:
/* if we are here everything is nice and ok*/
resp=CONN_RELEASE;
#ifdef EXTRA_DEBUG
- DBG("calling receive_msg(%p, %d, )\n",
+ DBG("receiving msg(%p, %d, )\n",
req->start, (int)(req->parsed-req->start));
#endif
/* rcv.bind_address should always be !=0 */
@@ -970,12 +1026,12 @@ again:
if (unlikely(req->state==H_HTTP11_CHUNK_FINISH)){
/* http chunked request */
req->body[req->content_len] = 0;
- ret = receive_msg(req->start,
+ ret = receive_tcp_msg(req->start,
req->body + req->content_len - req->start,
&con->rcv);
}else
#endif
- ret = receive_msg(req->start, req->parsed-req->start,
+ ret = receive_tcp_msg(req->start, req->parsed-req->start,
&con->rcv);
if (unlikely(ret < 0)) {
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#183 - tls module error on initialization when used together with the dialog module
User who did this - Daniel-Constantin Mierla (miconda)
----------
For keeping ssl lib linked dynamic, can you try attached patch? This one without the changes to db_postgress Makefile.
----------
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=183#comment458
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#183 - tls module error on initialization when used together with the dialog module
User who did this - Daniel-Constantin Mierla (miconda)
----------
One quick option is to link libssl static.
LIBS var in modules/db_postgres/Makefile should enclose libssl in linking flags like: -Wl,-Bstatic -lssl -Wl,-Bdynamic
Run 'pg_config --libdir' and see if -lssl is listed there, if yes, enclose it as above and set LIBS with the rest from pg_config and -lpq.
I'm going to try something else as well, to keep libssl linked dynamic.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=183#comment457
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
Daniel-Constantin Mierla has taken ownership of the following task:
FS#189 - dlg_manage() after t_newtran() does not work
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=189
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#189 - dlg_manage() after t_newtran() does not work
User who did this - Daniel-Constantin Mierla (miconda)
----------
Indeed, the way dialog module was designed initially requires to have the dlg flag set or dlg_manage() executed before creating the transaction. I will try to find a way for dlg_manage() after t_newtran(). If not possible in reasonable coding and no re-architecting, then I will add an internal check to issue a warning message when dlg_manage is executed too late.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=189#comment456
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#190 - async_sleep() does not work
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=190
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.