FACT++  1.0
static void recv_dns_dic_rout ( int  conn_id,
DNS_DIC_PACKET packet,
int  size,
int  status 
)
static

Definition at line 464 of file dic.c.

References COMMAND, dim_get_keepalive_timeout(), dim_panic(), dll_get_next(), dna_close(), dna_set_test_write(), Dns_dic_conn_id, DNS_DIC_HEADER, handle_dns_info(), ONCE_ONLY, dic_serv::pending, dic_serv::prev, request_dns_info(), dic_serv::serv_id, Service_pend_head, service_tmout(), DNS_DIC_PACKET::size, STA_CONN, STA_DATA, STA_DISC, dic_serv::type, WAITING_DNS_ANSWER, WAITING_DNS_UP, and WAITING_SERVER_UP.

Referenced by locate_service(), and request_dns_info().

465 {
466  register DIC_SERVICE *servp, *auxp;
467  void dim_panic(char *);
468 
469  if(size){}
470  switch( status )
471  {
472  case STA_DISC: /* connection broken */
473  servp = Service_pend_head;
474  while( (servp = (DIC_SERVICE *) dll_get_next(
476  (DLL *) servp)) )
477  {
478  if( (servp->pending == WAITING_DNS_ANSWER) ||
479  (servp->pending == WAITING_SERVER_UP))
480  {
481  if(( servp->type == COMMAND )||( servp->type == ONCE_ONLY ))
482  {
483  auxp = servp->prev;
484  servp->pending = WAITING_DNS_UP;
485  service_tmout( servp->serv_id );
486  servp = auxp;
487  }
488  else
489  {
490  servp->pending = WAITING_DNS_UP;
491  }
492  }
493  }
495  Dns_dic_conn_id = 0;
496  request_dns_info(0);
497  break;
498  case STA_CONN: /* connection received */
500  if(Dns_dic_conn_id < 0)
501  {
502  Dns_dic_conn_id = conn_id;
503  request_dns_info(0);
504 
505  }
506  break;
507  case STA_DATA: /* normal packet */
508  if( vtohl(packet->size) == DNS_DIC_HEADER )
509  {
510  handle_dns_info( packet );
511  }
512  break;
513  default: dim_panic( "recv_dns_dic_rout(): Bad switch" );
514  }
515 }
#define STA_DATA
Definition: dim.h:198
int dim_get_keepalive_timeout()
Definition: tcpip.c:128
static int Dns_dic_conn_id
Definition: dic.c:46
#define STA_DISC
Definition: dim.h:197
#define COMMAND
Definition: dim_common.h:10
static int handle_dns_info(DNS_DIC_PACKET *packet)
Definition: dic.c:1346
int dna_close(int conn_id)
Definition: dna.c:835
void dna_set_test_write(int conn_id, int time)
Definition: dna.c:606
PENDING_STATES pending
Definition: dim.h:476
#define DNS_DIC_HEADER
Definition: dim.h:319
int type
Definition: dim.h:465
Definition: dim.h:530
struct dic_serv * prev
Definition: dim.h:459
void dim_panic(char *s)
Definition: utilities.c:198
Definition: dim.h:457
int serv_id
Definition: dim.h:461
static void request_dns_info(int id)
Definition: dic.c:1245
int size
Definition: db_dim_server.c:17
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
void service_tmout(int serv_id)
Definition: dic.c:518
#define ONCE_ONLY
Definition: dim_common.h:7
#define STA_CONN
Definition: dim.h:199
int size
Definition: dim.h:307
static DIC_SERVICE * Service_pend_head
Definition: dic.c:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: