Skip to content

Commit

Permalink
Partial removal of USE_TCP
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu committed Feb 19, 2015
1 parent 8becb75 commit c488a94
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 66 deletions.
32 changes: 8 additions & 24 deletions cfg.y
Expand Up @@ -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 {
Expand Down Expand Up @@ -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");
}
Expand Down
2 changes: 0 additions & 2 deletions forward.c
Expand Up @@ -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;
Expand Down
9 changes: 2 additions & 7 deletions modules/dialog/dlg_timer.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
8 changes: 2 additions & 6 deletions modules/nathelper/nathelper.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions modules/presence/notify.c
Expand Up @@ -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*/
Expand All @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions modules/rls/notify.c
Expand Up @@ -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,
Expand All @@ -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)
{
Expand Down
3 changes: 0 additions & 3 deletions net/tcp_passfd.c
Expand Up @@ -25,8 +25,6 @@
* to handle signals (andrei)
*/

#ifdef USE_TCP

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
Expand Down Expand Up @@ -269,4 +267,3 @@ int receive_fd(int unix_socket, void* data, int data_len, int* fd, int flags)
error:
return ret;
}
#endif
8 changes: 0 additions & 8 deletions pt.c
Expand Up @@ -24,10 +24,6 @@
* 2007-06-07 - created to contain process handling functions (bogdan)
*/





#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
Expand All @@ -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;

Expand Down Expand Up @@ -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<proc_no ; i++ ) {
pt[i].unix_sock = -1;
pt[i].idx = -1;
}
#endif

/* set the pid for the starter process */
set_proc_attrs("starter");
Expand Down
2 changes: 0 additions & 2 deletions pt.h
Expand Up @@ -42,10 +42,8 @@

struct process_table {
int pid;
#ifdef USE_TCP
int unix_sock; /* unix socket on which tcp main listens */
int idx; /* tcp child index, -1 for other processes */
#endif
char desc[MAX_PT_DESC];

int default_debug; /* used when resetting the log level */
Expand Down
4 changes: 0 additions & 4 deletions statistics.c
Expand Up @@ -139,12 +139,10 @@ unsigned int calc_udp_load(void *val)
return ( get_stat_val((stat_var*)val) * 100) / *((int*)(((stat_var*)val)+1));
}

#ifdef USE_TCP
unsigned int calc_tcp_load(void *val)
{
return ( get_stat_val((stat_var*)val) * 100)/tcp_children_no;
}
#endif

int register_udp_load_stat(str *name, stat_var **s, int children)
{
Expand Down Expand Up @@ -177,7 +175,6 @@ int register_udp_load_stat(str *name, stat_var **s, int children)
return 0;
}

#ifdef USE_TCP
int register_tcp_load_stat(stat_var **s)
{
*s = shm_malloc(sizeof(stat_var));
Expand All @@ -202,7 +199,6 @@ int register_tcp_load_stat(stat_var **s)

return 0;
}
#endif


/************* Functions for handling MODULEs(groups) of stats ***************/
Expand Down

0 comments on commit c488a94

Please sign in to comment.