FACT++  1.0
void do_dis_stop_serving_dns ( DIS_DNS_CONN dnsp)

Definition at line 2222 of file dis.c.

References Client_head, close_dns(), cli_ent::conn_id, Debug_on, dim_print_date_time(), dim_stop_threads(), dis_dns_ent::dis_dns_packet, dis_dns_ent::dis_first_time, dis_hash_service_get_next(), dis_init(), dis_dns_ent::dis_n_services, dis_no_dns(), dis_remove_service(), dis_stop_serving(), Dis_timer_q, dll_empty(), dll_get_next(), dna_close(), dis_dns_ent::dns_dis_conn_id, dis_dns_ent::dns_timr_ent, dis_dns_ent::dnsid, serv::dnsp, cli_ent::dnsp, dtq_rem_entry(), serv::id, Net_conns, NET_CONNECTION::node, release_conn(), cli_ent::requestp_head, dis_dns_ent::serving, DIS_DNS_PACKET::size, SRC_DIS, DIS_DNS_PACKET::src_type, and NET_CONNECTION::task.

Referenced by dis_remove_service(), dis_stop_serving_dns(), and recv_dns_dis_rout().

2223 {
2224 register SERVICE *servp, *prevp;
2225 void dim_stop_threads(void);
2226 int dis_no_dns();
2227 int hash_index, old_index;
2228 extern int close_dns(dim_long, int);
2229 CLIENT *clip, *cprevp;
2230 
2231  dnsp->serving = 0;
2232  dis_init();
2233 /*
2234  dis_hash_service_init();
2235  prevp = 0;
2236  if(Dis_conn_id)
2237  {
2238  dna_close(Dis_conn_id);
2239  Dis_conn_id = 0;
2240  }
2241 */
2242  {
2243  DISABLE_AST
2244  if(dnsp->dns_timr_ent)
2245  {
2247  dnsp->dns_timr_ent = NULL;
2248  }
2249  if(dnsp->dns_dis_conn_id)
2250  {
2251  dna_close(dnsp->dns_dis_conn_id);
2252  dnsp->dns_dis_conn_id = 0;
2253  }
2254  ENABLE_AST
2255  }
2256  {
2257  DISABLE_AST
2258  prevp = 0;
2259  hash_index = -1;
2260  old_index = -1;
2261  while( (servp = dis_hash_service_get_next(&hash_index, prevp, 0)) )
2262  {
2263  if(servp->dnsp == dnsp)
2264  {
2265  ENABLE_AST
2266  dis_remove_service((unsigned)servp->id);
2267  {
2268  DISABLE_AST
2269  if(old_index != hash_index)
2270  prevp = 0;
2271  }
2272  }
2273  else
2274  {
2275  prevp = servp;
2276  old_index = hash_index;
2277  }
2278  }
2279  ENABLE_AST
2280  }
2281  {
2282  DISABLE_AST
2283  cprevp = Client_head;
2284  while( (clip = (CLIENT *)dll_get_next( (DLL *) Client_head,
2285  (DLL*) cprevp)) )
2286  {
2287  if(clip->dnsp != dnsp)
2288  {
2289  cprevp = clip;
2290  continue;
2291  }
2292  if( dll_empty((DLL *)clip->requestp_head) )
2293  {
2294 if(Debug_on)
2295 {
2297 printf("Releasing conn %d, to %s@%s\n",
2298  clip->conn_id,
2299  Net_conns[clip->conn_id].task, Net_conns[clip->conn_id].node);
2300 }
2301  release_conn( clip->conn_id, 0, 0);
2302  }
2303  else
2304  {
2305  cprevp = clip;
2306  }
2307  }
2308  ENABLE_AST
2309  }
2310 if(Debug_on)
2311 {
2313 printf("Cleaning dnsp variables\n");
2314 }
2315 
2316  dnsp->dis_first_time = 1;
2317  dnsp->dis_n_services = 0;
2318  dnsp->dis_dns_packet.size = 0;
2319  dnsp->dis_dns_packet.src_type = 0;
2320  close_dns(dnsp->dnsid, SRC_DIS);
2321 /*
2322  if(dnsp != Default_DNS)
2323  {
2324  dll_remove(dnsp);
2325  free(dnsp);
2326  }
2327 */
2328 /*
2329  if(dll_empty(DNS_head))
2330 */
2331  if(dis_no_dns())
2332  dis_stop_serving();
2333 }
int close_dns(dim_long dnsid, SRC_TYPES src_type)
Definition: open_dns.c:298
DIS_DNS_CONN * dnsp
Definition: dis.c:87
int serving
Definition: dis.c:46
int dns_dis_conn_id
Definition: dis.c:44
SERVICE * dis_hash_service_get_next(int *curr_index, SERVICE *prevp, int new_entries)
Definition: dis.c:3315
char task[MAX_TASK_NAME]
Definition: dim.h:408
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
Definition: dis.c:98
int dna_close(int conn_id)
Definition: dna.c:835
int dis_n_services
Definition: dis.c:43
static int release_conn(int conn_id, int print_flg, int dns_flag)
Definition: dis.c:2684
char node[MAX_NODE_NAME]
Definition: dim.h:407
static CLIENT * Client_head
Definition: dis.c:106
SRC_TYPES src_type
Definition: dim.h:271
int dis_remove_service(unsigned service_id)
Definition: dis.c:2112
dim_long dnsid
Definition: dis.c:39
int dis_no_dns()
Definition: dis.c:3375
Definition: dim.h:530
int conn_id
Definition: dis.c:101
Definition: dis.c:69
DIS_DNS_CONN * dnsp
Definition: dis.c:103
static int Dis_timer_q
Definition: dis.c:143
int dtq_rem_entry(int queue_id, TIMR_ENT *entry)
Definition: dtq.c:503
TIMR_ENT * dns_timr_ent
Definition: dis.c:41
long dim_long
Definition: dim_common.h:57
int dis_first_time
Definition: dis.c:45
REQUEST_PTR * requestp_head
Definition: dis.c:102
int size
Definition: dim.h:270
int dll_empty(DLL *head)
Definition: dll.c:88
void dis_init()
Definition: dis.c:220
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
void dim_print_date_time()
Definition: utilities.c:134
static int Debug_on
Definition: dis.c:156
DIS_DNS_PACKET dis_dns_packet
Definition: dis.c:42
void dim_stop_threads()
Definition: dim_thr.c:404
void dis_stop_serving()
Definition: dis.c:2343
int id
Definition: dis.c:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function: