FACT++  1.0
void dic_release_service ( unsigned  service_id)

Definition at line 1025 of file dic.c.

References COMMAND, dic_serv::conn_id, DELETED, DIC_HEADER, DIM_DELETE, dna_write(), dna_write_nowait(), Dns_dic_conn_id, id_get_ptr(), Memory::malloc(), MAX_NAME, NOT_PENDING, ONCE_ONLY, dic_serv::pending, release_service(), dic_serv::serv_id, dic_serv::serv_name, DIC_DNS_PACKET::service, service_id, DIC_PACKET::service_id, SERVICE_REQ::service_id, DIC_PACKET::service_name, SERVICE_REQ::service_name, DIC_PACKET::size, DIC_DNS_PACKET::size, SRC_DIC, DIC_DNS_PACKET::src_type, DIC_PACKET::type, dic_serv::type, WAITING_CMND_ANSWER, WAITING_DNS_ANSWER, WAITING_DNS_UP, and WAITING_SERVER_UP.

Referenced by cancel_pop_up(), delete_curr_service(), dic_close_dns(), dic_find_server_conns(), dic_get_id(), end_command(), findSmiServices(), Java_dim_Client_releaseService(), main(), ok_pop_up(), recv_rout(), send_service_command(), service_tmout(), DimInfo::~DimInfo(), and DimRpcInfo::~DimRpcInfo().

1026 {
1027  register DIC_SERVICE *servp;
1028  register int conn_id, pending;
1029  static DIC_PACKET *dic_packet;
1030  static int packet_size = 0;
1031  DIC_DNS_PACKET dic_dns_packet;
1032  register DIC_DNS_PACKET *dic_dns_p = &dic_dns_packet;
1033  SERVICE_REQ *serv_reqp;
1034  int release_service();
1035 
1036  DISABLE_AST
1037  if( !packet_size ) {
1038  dic_packet = (DIC_PACKET *)malloc((size_t)DIC_HEADER);
1039  packet_size = DIC_HEADER;
1040  }
1041  if( service_id == 0 )
1042  {
1043  ENABLE_AST
1044  return;
1045  }
1047  if( servp == 0 )
1048  {
1049  ENABLE_AST
1050  return;
1051  }
1052  if(servp->serv_id != (int)service_id)
1053  {
1054  ENABLE_AST
1055  return;
1056  }
1057  pending = servp->pending;
1058  switch( pending )
1059  {
1060  case NOT_PENDING :
1061  conn_id = servp->conn_id;
1062  strncpy(dic_packet->service_name, servp->serv_name, (size_t)MAX_NAME);
1063  dic_packet->type = htovl(DIM_DELETE);
1064  dic_packet->service_id = (int)htovl(service_id);
1065  dic_packet->size = htovl(DIC_HEADER);
1066  dna_write_nowait( conn_id, dic_packet, DIC_HEADER );
1067  release_service( servp );
1068  break;
1069  case WAITING_SERVER_UP :
1070  if( ( servp->type == COMMAND )||( servp->type == ONCE_ONLY ) )
1071  {
1072  servp->pending = DELETED;
1073  break;
1074  }
1075  if( Dns_dic_conn_id > 0) {
1076  dic_dns_p->size = htovl(sizeof(DIC_DNS_PACKET));
1077  dic_dns_p->src_type = htovl(SRC_DIC);
1078  serv_reqp = &dic_dns_p->service;
1079  strcpy( serv_reqp->service_name, servp->serv_name );
1080  serv_reqp->service_id = (int)htovl((unsigned)servp->serv_id | 0x80000000);
1081  dna_write( Dns_dic_conn_id, dic_dns_p,
1082  sizeof(DIC_DNS_PACKET) );
1083  }
1084  release_service( servp );
1085  break;
1086  case WAITING_CMND_ANSWER :
1087  case WAITING_DNS_UP :
1088  release_service( servp );
1089  break;
1090  case WAITING_DNS_ANSWER :
1091  servp->pending = DELETED;
1092  break;
1093  }
1094  ENABLE_AST
1095 }
#define MAX_NAME
Definition: dim.h:182
Definition: dim.h:454
static int Dns_dic_conn_id
Definition: dic.c:46
int type
Definition: dim.h:234
int dna_write(int conn_id, void *buffer, int size)
Definition: dna.c:455
unsigned service_id
Definition: db_dim_client.c:22
char service_name[MAX_NAME]
Definition: dim.h:232
int release_service(DIC_SERVICE *servicep)
Definition: dic.c:1098
SERVICE_REQ service
Definition: dim.h:302
int service_id
Definition: dim.h:233
#define COMMAND
Definition: dim_common.h:10
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
int service_id
Definition: dim.h:296
void * malloc()
Definition: EventBuilder.cc:99
#define DIC_HEADER
Definition: dim.h:240
PENDING_STATES pending
Definition: dim.h:476
SRC_TYPES src_type
Definition: dim.h:301
int type
Definition: dim.h:465
int conn_id
Definition: dim.h:475
Definition: dim.h:457
int size
Definition: dim.h:300
int serv_id
Definition: dim.h:461
int dna_write_nowait(int conn_id, void *buffer, int size)
Definition: dna.c:412
int size
Definition: dim.h:231
char service_name[MAX_NAME]
Definition: dim.h:295
char serv_name[MAX_NAME]
Definition: dim.h:460
#define ONCE_ONLY
Definition: dim_common.h:7
#define DIM_DELETE
Definition: dim_common.h:11

+ Here is the call graph for this function:

+ Here is the caller graph for this function: