*** empty log message ***

This commit is contained in:
Jeff Hill
1991-07-31 16:50:27 +00:00
parent 49856492d2
commit 3959edb8bb
6 changed files with 71 additions and 38 deletions

View File

@@ -30,14 +30,17 @@
/* 060591 joh delinting */
/* 061391 joh RISC alignment in outgoing messages */
/* 070191 joh allways use memcpy in ca_put */
/* 071291 joh added CLAIM_CIU message */
/* 071291 joh added CLAIM_CIU message */
/* 072391 joh added event locking for vxWorks */
/* 072591 joh quick POLL in ca_pend_io() should return */
/* ECA_NORMAL not ECA_TIMEOUT if pend count == 0 */
/* */
/*_begin */
/************************************************************************/
/* */
/* Title: IOC high level access routines */
/* File: atcs:[ca]access.c */
/* Environment: VMS, UNIX, VRTX */
/* File: access.c */
/* Environment: VMS, UNIX, vxWorks */
/* Equipment: VAX, SUN, VME */
/* */
/* */
@@ -50,8 +53,7 @@
/* Special comments */
/* ------- -------- */
/* Things that could be done to improve this code */
/* 1) Check timeouts on ca_pend for values to large */
/* 2) Allow them to recv channel A when channel B changes */
/* 1) Allow them to recv channel A when channel B changes */
/* */
/************************************************************************/
/*_end */
@@ -249,6 +251,7 @@ ca_task_initialize
ca_static->ca_tid = taskIdSelf();
FASTLOCKINIT(&client_lock);
FASTLOCKINIT(&event_lock);
evuser = (void *) db_init_events();
if (!evuser)
@@ -781,7 +784,9 @@ ca_build_and_connect
args.chid = chix;
args.op = CA_OP_CONN_UP;
LOCKEVENTS;
(*chix->connection_func) (args);
UNLOCKEVENTS;
}
return ECA_NORMAL;
}
@@ -1648,6 +1653,7 @@ void *pfl;
* I would like to tell um with the event handler but this would
* not be upward compatible. so I run the exception handler.
*/
LOCKEVENTS;
if(status == ERROR){
if(ca_static->ca_exception_func){
struct exception_handler_args args;
@@ -1664,13 +1670,15 @@ void *pfl;
(*ca_static->ca_exception_func)(args);
}
}
else
else{
(*monix->usr_func)(
monix->usr_arg,
monix->chan,
type,
count,
pval);
}
UNLOCKEVENTS;
/*
*
@@ -1962,9 +1970,8 @@ int early;
cac_send_msg();
UNLOCK;
if(pndrecvcnt<1)
if(early)
return ECA_NORMAL;
if(pndrecvcnt<1 && early)
return ECA_NORMAL;
/*
* quick exit if a poll
@@ -1992,6 +1999,9 @@ int early;
UNLOCK;
}
#endif
if(pndrecvcnt<1 && early)
return ECA_NORMAL;
return ECA_TIMEOUT;
}
@@ -2034,14 +2044,13 @@ int early;
lib$signal(status);
}
#endif
if(pndrecvcnt<1)
if(early)
return ECA_NORMAL;
LOCK;
manage_conn(TRUE);
UNLOCK;
if(pndrecvcnt<1 && early)
return ECA_NORMAL;
if(timeout != 0.0){
if(timeout < time(NULL)-beg_time){
struct ioc_in_use *piiu;

View File

@@ -123,6 +123,8 @@ void vms_recv_msg_ast();
/*
* ALLOC_IOC()
*
* allocate and initialize an IOC info block for unallocated IOC
*
* LOCK should be on while in this routine
*/
alloc_ioc(pnet_addr, net_proto, iocix)
@@ -203,8 +205,6 @@ client_channel_exists(chan)
/*
* CREATE_NET_CHANNEL()
*
* allocate and initialize an IOC info block for unallocated IOC
*
* LOCK should be on while in this routine
*/
create_net_chan(piiu)
@@ -337,8 +337,6 @@ struct ioc_in_use *piiu;
}
#endif
/* connect */
status = connect(
sock,
@@ -352,7 +350,6 @@ struct ioc_in_use *piiu;
}
return ECA_CONN;
}
piiu->max_msg = MAX_TCP;
/*
@@ -420,7 +417,7 @@ struct ioc_in_use *piiu;
ca_signal(ECA_INTERNAL,"alloc_ioc: ukn protocol\n");
}
/* setup cac_send_msg(), recv_msg() buffers */
if(!piiu->send)
if(!piiu->send){
if(! (piiu->send = (struct buffer *)
malloc(sizeof(struct buffer))) ){
status = socket_close(sock);
@@ -429,9 +426,11 @@ struct ioc_in_use *piiu;
}
return ECA_ALLOCMEM;
}
}
piiu->send->stk = 0;
if(!piiu->recv)
if(!piiu->recv){
if(! (piiu->recv = (struct buffer *)
malloc(sizeof(struct buffer))) ){
status = socket_close(sock);
@@ -440,11 +439,15 @@ struct ioc_in_use *piiu;
}
return ECA_ALLOCMEM;
}
}
piiu->recv->stk = 0;
piiu->conn_up = TRUE;
if(fd_register_func)
if(fd_register_func){
LOCKEVENTS;
(*fd_register_func)(fd_register_arg, sock, TRUE);
UNLOCKEVENTS;
}
/* Set up recv thread for VMS */
@@ -1099,12 +1102,17 @@ struct ioc_in_use *piiu;
if(chix->connection_func){
args.chid = chix;
args.op = CA_OP_CONN_DOWN;
LOCKEVENTS;
(*chix->connection_func)(args);
UNLOCKEVENTS;
}
}
if(fd_register_func)
if(fd_register_func){
LOCKEVENTS;
(*fd_register_func)(fd_register_arg, piiu->sock_chan, FALSE);
UNLOCKEVENTS;
}
status = socket_close(piiu->sock_chan);
if(status < 0){

View File

@@ -12,6 +12,7 @@
/* .01 08xx87 joh Init Release */
/* .02 01xx90 joh fd_set in the UNIX version only */
/* .03 060691 joh Rearanged buffer struct for SPARC port */
/* .04 072391 joh new lock prevents event preemption on vxWorks */
/* */
/*_begin */
/************************************************************************/
@@ -136,6 +137,7 @@ typedef unsigned long ca_time;
#define io_done_flag (ca_static->ca_io_done_flag)
#define evuser (ca_static->ca_evuser)
#define client_lock (ca_static->ca_client_lock)
#define event_lock (ca_static->ca_event_lock)
#define local_chidlist (ca_static->ca_local_chidlist)
#define dbfree_ev_list (ca_static->ca_dbfree_ev_list)
#define lcl_buff_list (ca_static->ca_lcl_buff_list)
@@ -171,7 +173,8 @@ struct ca_static{
#ifdef vxWorks
int ca_io_done_flag;
void *ca_evuser;
FAST_LOCK ca_client_lock;
FAST_LOCK ca_client_lock;
FAST_LOCK ca_event_lock; /* dont allow events to preempt */
int ca_tid;
LIST ca_local_chidlist;
LIST ca_dbfree_ev_list;

View File

@@ -32,16 +32,22 @@
astenblwas = sys$setast(FALSE);
# define UNLOCK\
if(astenblwas == SS$_WASSET)sys$setast(TRUE);}
# define LOCKEVENTS
# define UNLOCKEVENTS
#endif
#ifdef vxWorks
# define LOCK FASTLOCK(&client_lock);
# define UNLOCK FASTUNLOCK(&client_lock);
# define LOCK FASTLOCK(&client_lock);
# define UNLOCK FASTUNLOCK(&client_lock);
# define LOCKEVENTS FASTLOCK(&event_lock);
# define UNLOCKEVENTS FASTUNLOCK(&event_lock);
#endif
#ifdef UNIX
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
#endif
#ifdef vxWorks

View File

@@ -24,6 +24,7 @@
/* 071291 joh now claiming channel in use block over TCP so */
/* problems with duplicate port assigned to */
/* client after reboot go away */
/* 072391 joh added event locking for vxWorks */
/* */
/*_begin */
/************************************************************************/
@@ -63,7 +64,9 @@
#include <iocmsg.h>
#include <iocinf.h>
void reconnect_channel();
void reconnect_channel();
void ca_request_event();
#define BUFSTAT printf("expected %d left %d\n",msgcnt,*pbufcnt);
@@ -162,7 +165,9 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
args.count = t_count;
args.dbr = (void *) (hdrptr + 1);
LOCKEVENTS;
(*monix->usr_func) (args);
UNLOCKEVENTS;
}
LOCK;
lstDelete(&pend_read_list, monix);
@@ -229,7 +234,9 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
args.dbr = (void *) (hdrptr + 1);
/* call their handler */
LOCKEVENTS;
(*monix->usr_func) (args);
UNLOCKEVENTS;
break;
}
@@ -494,7 +501,10 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
args.addr = (void *) (req->m_available);
args.stat = ntohl((int) t_available); args.op = op;
args.ctx = context;
LOCKEVENTS;
(*ca_static->ca_exception_func) (args);
UNLOCKEVENTS;
break;
}
default:
@@ -529,7 +539,6 @@ struct in_addr *pnet_addr;
evid pevent;
int status;
void ca_request_event();
LOCK;
@@ -606,7 +615,9 @@ struct in_addr *pnet_addr;
args.chid = chan;
args.op = CA_OP_CONN_UP;
LOCKEVENTS;
(*chan->connection_func)(args);
UNLOCKEVENTS;
}
else if(chan->state==cs_never_conn){
/* decrement the outstanding IO count */

View File

@@ -122,9 +122,9 @@ FAST int sock;
return;
}
if(MPDEBUG==2){
if(MPDEBUG>0){
logMsg( "camsgtask: Recieved connection request\n");
logMsg("from addr %x, udp port %x \n",
logMsg("from addr %x, port %x \n",
client->addr.sin_addr,
client->addr.sin_port);
}
@@ -171,12 +171,14 @@ FAST int sock;
/*
* normal conn lost conditions
*/
if(anerrno == ECONNABORTED || anerrno == ECONNRESET){
break;
if(MPDEBUG==0){
if(anerrno==ECONNABORTED||anerrno==ECONNRESET){
break;
}
}
logMsg("camsgtask: Exiting after msg recv error\n");
printErrno(errnoGet(taskIdSelf()));
printErrno(anerrno);
break;
}
@@ -227,12 +229,6 @@ FAST int sock;
cas_send_msg(client, TRUE);
}
/*
* dont hang around if there are no
* connections to process variables
*/
if (client->addrq.count == 0)
break;
}
free_client(client);