From c488a94956cd5892ac6e86d339ff16d5cf01ac98 Mon Sep 17 00:00:00 2001 From: Bogdan-Andrei Iancu Date: Fri, 20 Feb 2015 01:02:17 +0200 Subject: [PATCH] Partial removal of USE_TCP --- cfg.y | 32 ++++++++------------------------ forward.c | 2 -- modules/dialog/dlg_timer.c | 9 ++------- modules/nathelper/nathelper.c | 8 ++------ modules/presence/notify.c | 6 +----- modules/rls/notify.c | 6 +----- net/tcp_passfd.c | 3 --- pt.c | 8 -------- pt.h | 2 -- statistics.c | 4 ---- 10 files changed, 14 insertions(+), 66 deletions(-) diff --git a/cfg.y b/cfg.y index a6937e2ec7b..e7cfdec3917 100644 --- a/cfg.y +++ b/cfg.y @@ -776,11 +776,7 @@ assign_stm: DEBUG EQUAL snumber { } | TCP_KEEPALIVE EQUAL error { yyerror("boolean value expected"); } | TCP_MAX_MSG_TIME EQUAL NUMBER { - #ifdef USE_TCP - tcp_max_msg_time=$3; - #else - warn("tcp support not compiled in"); - #endif + tcp_max_msg_time=$3; } | TCP_MAX_MSG_TIME EQUAL error { yyerror("boolean value expected"); } | TCP_KEEPCOUNT EQUAL NUMBER { @@ -2208,27 +2204,15 @@ cmd: FORWARD LPAREN STRING RPAREN { mk_action2( $$, FORWARD_T, | FORCE_LOCAL_RPORT { mk_action2( $$, FORCE_LOCAL_RPORT_T,0, 0, 0, 0); } | FORCE_TCP_ALIAS LPAREN NUMBER RPAREN { - #ifdef USE_TCP - mk_action2( $$, FORCE_TCP_ALIAS_T,NUMBER_ST, 0, - (void*)$3, 0); - #else - yyerror("tcp support not compiled in"); - #endif - } + mk_action2( $$, FORCE_TCP_ALIAS_T,NUMBER_ST, 0, + (void*)$3, 0); + } | FORCE_TCP_ALIAS LPAREN RPAREN { - #ifdef USE_TCP - mk_action2( $$, FORCE_TCP_ALIAS_T,0, 0, 0, 0); - #else - yyerror("tcp support not compiled in"); - #endif - } + mk_action2( $$, FORCE_TCP_ALIAS_T,0, 0, 0, 0); + } | FORCE_TCP_ALIAS { - #ifdef USE_TCP - mk_action2( $$, FORCE_TCP_ALIAS_T,0, 0, 0, 0); - #else - yyerror("tcp support not compiled in"); - #endif - } + mk_action2( $$, FORCE_TCP_ALIAS_T,0, 0, 0, 0); + } | FORCE_TCP_ALIAS LPAREN error RPAREN {$$=0; yyerror("bad argument, number expected"); } diff --git a/forward.c b/forward.c index fac404c637b..8019c378526 100644 --- a/forward.c +++ b/forward.c @@ -493,10 +493,8 @@ int forward_reply(struct sip_msg* msg) int proto; int id; /* used only by tcp*/ struct socket_info *send_sock; -#ifdef USE_TCP char* s; int len; -#endif to=0; id=0; diff --git a/modules/dialog/dlg_timer.c b/modules/dialog/dlg_timer.c index aeeccf04bf7..80c839fec16 100644 --- a/modules/dialog/dlg_timer.c +++ b/modules/dialog/dlg_timer.c @@ -674,9 +674,7 @@ void dlg_ping_routine(unsigned int ticks , void * attr) it = curr; } -#ifdef USE_TCP - tcp_no_new_conn = 1; -#endif + tcp_no_new_conn = 1; /* ping_timer->first now contains all active dialogs */ it = ping_timer->first; @@ -708,8 +706,5 @@ void dlg_ping_routine(unsigned int ticks , void * attr) it = it->next; } -#ifdef USE_TCP - tcp_no_new_conn = 0; -#endif - + tcp_no_new_conn = 0; } diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c index f367dd8bab4..40c50e2441e 100644 --- a/modules/nathelper/nathelper.c +++ b/modules/nathelper/nathelper.c @@ -1297,9 +1297,7 @@ nh_timer(unsigned int ticks, void *timer_idx) if (buf == NULL) goto done; -#ifdef USE_TCP - tcp_no_new_conn = 1; -#endif + tcp_no_new_conn = 1; cp = buf; while (1) { @@ -1362,9 +1360,7 @@ nh_timer(unsigned int ticks, void *timer_idx) } } -#ifdef USE_TCP - tcp_no_new_conn = 0; -#endif + tcp_no_new_conn = 0; done: if (buf) diff --git a/modules/presence/notify.c b/modules/presence/notify.c index a6189e9fff4..ac30eced5b1 100644 --- a/modules/presence/notify.c +++ b/modules/presence/notify.c @@ -1991,10 +1991,8 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs, if (notify_body && subs->event->aux_body_processing) aux_body = subs->event->aux_body_processing(subs, notify_body); -#ifdef USE_TCP - /* don't open new TCP connections if connection is down */ + /* don't open new TCP connections if connection is down */ tcp_no_new_conn = 1; -#endif result = tmb.t_request_within (&met, /* method*/ @@ -2005,9 +2003,7 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs, (void*)cb_param, /* callback parameter*/ NULL); -#ifdef USE_TCP tcp_no_new_conn = 0; -#endif if(aux_body) { if(aux_body->s) diff --git a/modules/rls/notify.c b/modules/rls/notify.c index adc9db35289..5931a7a1745 100644 --- a/modules/rls/notify.c +++ b/modules/rls/notify.c @@ -723,10 +723,8 @@ int rls_send_notify(subs_t* subs, str* body, str* start_cid, } LM_DBG("str_hdr= %.*s\n", str_hdr.len, str_hdr.s); -#ifdef USE_TCP - /* don't open new TCP connections if connection is down */ + /* don't open new TCP connections if connection is down */ tcp_no_new_conn = 1; -#endif rt = tmb.t_request_within (&met, @@ -737,9 +735,7 @@ int rls_send_notify(subs_t* subs, str* body, str* start_cid, (void*)cb_param, NULL); -#ifdef USE_TCP tcp_no_new_conn = 0; -#endif if(rt < 0) { diff --git a/net/tcp_passfd.c b/net/tcp_passfd.c index 001008ba0bc..4964ca72464 100644 --- a/net/tcp_passfd.c +++ b/net/tcp_passfd.c @@ -25,8 +25,6 @@ * to handle signals (andrei) */ -#ifdef USE_TCP - #include #include #include @@ -269,4 +267,3 @@ int receive_fd(int unix_socket, void* data, int data_len, int* fd, int flags) error: return ret; } -#endif diff --git a/pt.c b/pt.c index 10d5b462953..3dfa33d4322 100644 --- a/pt.c +++ b/pt.c @@ -24,10 +24,6 @@ * 2007-06-07 - created to contain process handling functions (bogdan) */ - - - - #include #include #include @@ -52,9 +48,7 @@ unsigned int counted_processes = 0; int init_multi_proc_support(void) { unsigned short proc_no; - #ifdef USE_TCP unsigned int i; - #endif proc_no = 0; @@ -88,12 +82,10 @@ int init_multi_proc_support(void) } memset(pt, 0, sizeof(struct process_table)*proc_no); - #ifdef USE_TCP for( i=0 ; i