FACT++  1.0
int release_service ( DIC_SERVICE servicep)

Definition at line 1098 of file dic.c.

References dic_serv::conn_id, Debug_on, Dic_conns, Dic_timer_q, dim_print_date_time(), dll_empty(), dll_get_next(), dll_remove(), dtq_rem_entry(), dic_serv::fill_address, dic_serv::fill_size, Memory::free(), id, id_free(), locate_command(), MAX_NAME, DIC_CONNECTION::node_name, release_conn(), dic_serv::serv_id, dic_serv::serv_name, DIC_CONNECTION::service_head, SRC_DIC, DIC_CONNECTION::task_name, and dic_serv::timer_ent.

Referenced by dic_release_service(), and handle_dns_info().

1099 {
1100  register DIC_SERVICE *servp;
1101  register int conn_id = 0;
1102  register int found = 0;
1103  register DIC_CONNECTION *dic_connp;
1104  char name[MAX_NAME], *ptr;
1105  int id;
1106 
1107  id = servicep->serv_id;
1108  servicep->serv_id = 0;
1109  conn_id = servicep->conn_id;
1110  dic_connp = &Dic_conns[conn_id] ;
1111  dll_remove( (DLL *) servicep );
1112  if( servicep->timer_ent )
1113  {
1114  dtq_rem_entry( Dic_timer_q, servicep->timer_ent );
1115  }
1116 /*
1117  if(servicep->type != COMMAND)
1118 */
1119  if(servicep->fill_size > 0)
1120  free( servicep->fill_address );
1121  if(strstr(servicep->serv_name,"/RpcOut"))
1122  {
1123  strcpy(name, servicep->serv_name);
1124  }
1125  else
1126  name[0] = '\0';
1127  free( servicep );
1128  if( conn_id && dic_connp->service_head )
1129  {
1130  if( dll_empty((DLL *)dic_connp->service_head) )
1131  {
1132  if( (servp = (DIC_SERVICE *) Cmnd_head) )
1133  {
1134  while( (servp = (DIC_SERVICE *) dll_get_next(
1135  (DLL *) Cmnd_head,
1136  (DLL *) servp)) )
1137  {
1138  if( servp->conn_id == conn_id)
1139  found = 1;
1140  }
1141  }
1142  if( !found)
1143  {
1144  if(Debug_on)
1145  {
1147  printf("Conn %d, Server %s on node %s released\n",
1148  conn_id, dic_connp->task_name, dic_connp->node_name);
1149  fflush(stdout);
1150  }
1151  release_conn( conn_id );
1152  }
1153  }
1154  }
1155  if(name[0])
1156  {
1157  ptr = strstr(name,"/RpcOut");
1158  strcpy(ptr + 4, "In");
1159  if( (servp = locate_command(name)) )
1160  release_service(servp);
1161  }
1162  id_free(id, SRC_DIC);
1163  return(1);
1164 }
#define MAX_NAME
Definition: dim.h:182
int * fill_address
Definition: dim.h:470
DIM_NOSHARE DIC_CONNECTION * Dic_conns
Definition: conn_handler.c:30
int release_service(DIC_SERVICE *servicep)
Definition: dic.c:1098
char * service_head
Definition: dim.h:424
DIC_SERVICE * locate_command(char *serv_name)
Definition: dic.c:1202
char id[4]
Definition: FITS.h:71
static void release_conn(int conn_id)
Definition: dic.c:2121
void dll_remove(DLL *item)
Definition: dll.c:100
Definition: dim.h:530
int dtq_rem_entry(int queue_id, TIMR_ENT *entry)
Definition: dtq.c:503
int conn_id
Definition: dim.h:475
static DIC_SERVICE * Cmnd_head
Definition: dic.c:42
Definition: dim.h:457
char node_name[MAX_NODE_NAME]
Definition: dim.h:420
int serv_id
Definition: dim.h:461
int dll_empty(DLL *head)
Definition: dll.c:88
void id_free(int id, SRC_TYPES type)
Definition: conn_handler.c:206
void free(void *mem)
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
TIMR_ENT * timer_ent
Definition: dim.h:474
char serv_name[MAX_NAME]
Definition: dim.h:460
void dim_print_date_time()
Definition: utilities.c:134
char task_name[MAX_TASK_NAME]
Definition: dim.h:421
int fill_size
Definition: dim.h:471
static int Dic_timer_q
Definition: dic.c:45
static int Debug_on
Definition: dic.c:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function: