FACT++  1.0
void dis_stop_serving ( )

Definition at line 2343 of file dis.c.

References dim_stop_threads(), Dis_conn_id, dis_find_client_conns(), Dis_first_time, dis_hash_service_get_next(), dis_init(), dis_remove_service(), Dis_timer_q, dna_close(), dtq_delete(), serv::id, and Serving.

Referenced by do_dis_stop_serving_dns().

2344 {
2345 register SERVICE *servp, *prevp;
2346 void dim_stop_threads(void);
2347 int dis_find_client_conns();
2348 int hash_index;
2349 
2350 /*
2351  if(Serving != -1)
2352 */
2353  Serving = 0;
2354  dis_init();
2355  if(Dis_conn_id)
2356  {
2358  Dis_conn_id = 0;
2359  }
2360 /*
2361  if(Dns_dis_conn_id)
2362  {
2363  dna_close(Dns_dis_conn_id);
2364  Dns_dis_conn_id = 0;
2365  }
2366 */
2367  {
2368  DISABLE_AST
2369  prevp = 0;
2370  hash_index = -1;
2371  while( (servp = dis_hash_service_get_next(&hash_index, prevp, 0)) )
2372  {
2373  ENABLE_AST
2374  dis_remove_service((unsigned)servp->id);
2375  {
2376  DISABLE_AST
2377  prevp = 0;
2378  }
2379  }
2380  ENABLE_AST
2381  }
2382 /*
2383  if(Dis_conn_id)
2384  dna_close(Dis_conn_id);
2385  if(Dns_dis_conn_id)
2386  dna_close(Dns_dis_conn_id);
2387  Dns_dis_conn_id = 0;
2388 */
2389  Dis_first_time = 1;
2390 /*
2391  if(Dns_timr_ent)
2392  {
2393  dtq_rem_entry(Dis_timer_q, Dns_timr_ent);
2394  Dns_timr_ent = NULL;
2395  }
2396 */
2398  Dis_timer_q = 0;
2399 /*
2400  if(Serving != -1)
2401 */
2402  if(!dis_find_client_conns())
2403  dim_stop_threads();
2404 }
int dtq_delete(int queue_id)
Definition: dtq.c:378
SERVICE * dis_hash_service_get_next(int *curr_index, SERVICE *prevp, int new_entries)
Definition: dis.c:3315
int dna_close(int conn_id)
Definition: dna.c:835
int dis_remove_service(unsigned service_id)
Definition: dis.c:2112
Definition: dis.c:69
static int Dis_timer_q
Definition: dis.c:143
static int Dis_first_time
Definition: dis.c:116
static int Dis_conn_id
Definition: dis.c:122
int dis_find_client_conns()
Definition: dis.c:2406
void dis_init()
Definition: dis.c:220
static int Serving
Definition: dis.c:124
void dim_stop_threads()
Definition: dim_thr.c:404
int id
Definition: dis.c:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function: