... | ... |
@@ -46,7 +46,7 @@ ARCH = $(shell uname -s) |
46 | 46 |
# malloc etc.) |
47 | 47 |
DEFS= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \ |
48 | 48 |
-DDNS_IP_HACK -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP \ |
49 |
- -DNO_DEBUG -DDBG_QM_MALLOC |
|
49 |
+ -DDBG_QM_MALLOC #-DNO_DEBUG # |
|
50 | 50 |
#-DEXTRA_DEBUG |
51 | 51 |
# -DUSE_SHM_MEM |
52 | 52 |
#-DNO_DEBUG |
... | ... |
@@ -223,10 +223,11 @@ int daemonize(char* name) |
223 | 223 |
} |
224 | 224 |
|
225 | 225 |
/* close any open file descriptors */ |
226 |
- for (r=0;r<MAX_FD; r++){ |
|
227 |
- if ((r==3) && log_stderr) continue; |
|
228 |
- close(r); |
|
229 |
- } |
|
226 |
+ if (log_stderr==0) |
|
227 |
+ for (r=0;r<MAX_FD; r++){ |
|
228 |
+ if ((r==3) && log_stderr) continue; |
|
229 |
+ close(r); |
|
230 |
+ } |
|
230 | 231 |
return 0; |
231 | 232 |
|
232 | 233 |
error: |
... | ... |
@@ -286,7 +287,7 @@ int main_loop() |
286 | 287 |
return udp_rcv_loop(); |
287 | 288 |
} |
288 | 289 |
} |
289 |
- close(udp_sock); /*parent*/ |
|
290 |
+ /*close(udp_sock);*/ /*parent*/ |
|
290 | 291 |
} |
291 | 292 |
} |
292 | 293 |
/*this is the main process*/ |
... | ... |
@@ -33,13 +33,15 @@ |
33 | 33 |
|
34 | 34 |
|
35 | 35 |
#define insert_into_timer(hash_table,new_tl,list_id,time_out) \ |
36 |
- insert_into_timer_list(hash_table,new_tl,list_id,(get_ticks()+time_out)) |
|
36 |
+ insert_into_timer_list((hash_table), (new_tl), (list_id), \ |
|
37 |
+ (get_ticks()+(time_out))) |
|
37 | 38 |
|
38 | 39 |
#define add_to_tail_of_timer(hash_table,new_tl,list_id,time_out) \ |
39 |
- add_to_tail_of_timer_list(hash_table,new_tl,list_id,(get_ticks()+time_out)) |
|
40 |
+ add_to_tail_of_timer_list((hash_table), (new_tl), (list_id), \ |
|
41 |
+ (get_ticks()+(time_out))) |
|
40 | 42 |
|
41 | 43 |
#define remove_from_timer(hash_table,tl,list_id) \ |
42 |
- remove_from_timer_list( hash_table , tl , list_id)\ |
|
44 |
+ remove_from_timer_list( (hash_table), (tl) , (list_id)) |
|
43 | 45 |
|
44 | 46 |
|
45 | 47 |
|
... | ... |
@@ -59,9 +61,9 @@ int tm_startup() |
59 | 61 |
|
60 | 62 |
/* installing handlers for timers */ |
61 | 63 |
hash_table->timers[RETRASMISSIONS_LIST].timeout_handler = retransmission_handler; |
62 |
- hash_table->timers[FR_TIMER_LIST].timeout_handler = final_response_handler; |
|
63 |
- hash_table->timers[WT_TIMER_LIST].timeout_handler = wait_handler; |
|
64 |
- hash_table->timers[DELETE_LIST].timeout_handler = delete_handler; |
|
64 |
+ hash_table->timers[FR_TIMER_LIST].timeout_handler = final_response_handler; |
|
65 |
+ hash_table->timers[WT_TIMER_LIST].timeout_handler = wait_handler; |
|
66 |
+ hash_table->timers[DELETE_LIST].timeout_handler = delete_handler; |
|
65 | 67 |
|
66 | 68 |
/* register the timer function */ |
67 | 69 |
register_timer( timer_routine , hash_table , 1 ); |
... | ... |
@@ -100,7 +102,8 @@ void tm_shutdown() |
100 | 102 |
/* destroy the hash table */ |
101 | 103 |
DBG("DEBUG: tm_shutdown : empting hash table\n"); |
102 | 104 |
free_hash_table( hash_table ); |
103 |
- |
|
105 |
+ DBG("DEBUG: tm_shutdown : removing semaphores\n"); |
|
106 |
+ lock_cleanup(); |
|
104 | 107 |
DBG("DEBUG: tm_shutdown : done\n"); |
105 | 108 |
} |
106 | 109 |
|
... | ... |
@@ -2,11 +2,11 @@ debug=9 # debug level (cmd line: -dddddddddd) |
2 | 2 |
check_via=yes # (cmd. line: -v) |
3 | 3 |
dns=on # (cmd. line: -r) |
4 | 4 |
rev_dns=yes # (cmd. line: -R) |
5 |
-fork=no # (cmd. line: -D) |
|
6 |
-#children=4 |
|
5 |
+fork=yes # (cmd. line: -D) |
|
6 |
+children=4 |
|
7 | 7 |
log_stderror=yes # (cmd line: -E) |
8 | 8 |
#port=5080 |
9 |
-#listen=127.0.0.1 |
|
9 |
+listen=127.0.0.1 |
|
10 | 10 |
loop_checks=1 |
11 | 11 |
# for more info: sip_router -h |
12 | 12 |
|
... | ... |
@@ -24,7 +24,7 @@ route{ |
24 | 24 |
if ( t_lookup_request()) { |
25 | 25 |
if ( method=="ACK" ) { |
26 | 26 |
log("SER: ACK received -> t_release\n"); |
27 |
- if (! t_forward("195.37.78.233", "6666" )) { |
|
27 |
+ if (! t_forward("127.0.0.1", "5090" )) { |
|
28 | 28 |
log("SER: WARNING: bad forward\n"); |
29 | 29 |
}; |
30 | 30 |
if (! t_release()) { |
... | ... |
@@ -58,12 +58,12 @@ route{ |
58 | 58 |
#t_forward("benetnash.fokus.gmd.de", "5080" ); |
59 | 59 |
if (method=="BYE") { |
60 | 60 |
log("SER: BYE received, HACK: forwarding to client\n"); |
61 |
- if (! t_forward("195.37.78.233", "5555")){ |
|
61 |
+ if (! t_forward("127.0.0.1", "5000")){ |
|
62 | 62 |
log("SER:ERROR: t_forward (..., 5555)\n"); |
63 | 63 |
}; |
64 | 64 |
|
65 | 65 |
}else{ |
66 |
- if (! t_forward("195.37.78.233", "6666" )){ |
|
66 |
+ if (! t_forward("127.0.0.1", "5090" )){ |
|
67 | 67 |
log("SER:ERROR: t_forward (..., 6666)\n"); |
68 | 68 |
}; |
69 | 69 |
}; |