Module: sip-router Branch: master Commit: eea7f9d04090a736c8a0f2b2a350c08635cc8e39 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eea7f9d0...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed May 21 09:55:46 2014 +0200
core: allow listening on tls without listening on tcp
- reported in FS#425
---
main.c | 12 ++++++++++++ tcp_main.c | 11 +++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/main.c b/main.c index 89115a4..bcfcf9f 100644 --- a/main.c +++ b/main.c @@ -1787,6 +1787,18 @@ static int calc_proc_no(void) tcp_e_listeners = tcp_cfg_children_no; } tcp_listeners += tcp_e_listeners; +#ifdef USE_TLS + tcp_e_listeners = 0; + for (si=tls_listen, tcp_listeners=0, tcp_e_listeners=0; si; si=si->next) { + if(si->workers>0) + tcp_listeners += si->workers; + else { + if(tcp_listeners==0) + tcp_e_listeners = tcp_cfg_children_no; + } + } + tcp_listeners += tcp_e_listeners; +#endif tcp_children_no = tcp_listeners; #endif #ifdef USE_SCTP diff --git a/tcp_main.c b/tcp_main.c index 701f90f..5a43d2c 100644 --- a/tcp_main.c +++ b/tcp_main.c @@ -4934,6 +4934,17 @@ int tcp_init_children() } } } +#ifdef USE_TLS + for(si=tls_listen; si; si=si->next) { + if(si->workers>0) { + si->workers_tcpidx = i - si->workers + 1; + for(r=0; r<si->workers; r++) { + tcp_children[i].mysocket = si; + i--; + } + } + } +#endif tcp_sockets_gworkers = (i != tcp_children_no-1)?(1 + i + 1):0;
/* create the tcp sock_info structures */