updated for changes in bucketLib.c

This commit is contained in:
Jeff Hill
1994-11-14 18:47:18 +00:00
parent 0ba3898e81
commit 7bb451bb74
5 changed files with 39 additions and 17 deletions
+19 -11
View File
@@ -182,7 +182,7 @@ LOCAL void access_rights_reply(
struct channel_in_use *pciu
);
LOCAL unsigned long bucketID;
LOCAL unsigned bucketID;
/*
@@ -204,7 +204,7 @@ struct message_buffer *recv
struct channel_in_use *pciu;
if(!pCaBucket){
pCaBucket = bucketCreate(NBBY*sizeof(mp->m_cid));
pCaBucket = bucketCreate(CAS_HASH_TABLE_SIZE);
if(!pCaBucket){
return ERROR;
}
@@ -1183,7 +1183,7 @@ struct client *client
}
FASTLOCK(&rsrv_free_addrq_lck);
status = bucketRemoveItem(pCaBucket, pciu->sid, pciu);
status = bucketRemoveItemUnsignedId (pCaBucket, &pciu->sid);
if(status != BUCKET_SUCCESS){
logBadId(client, mp);
}
@@ -1544,12 +1544,12 @@ struct client *client
)
{
struct extmsg *search_reply;
struct extmsg *get_reply;
unsigned short *pMinorVersion;
int status;
struct db_addr tmp_addr;
struct channel_in_use *pchannel;
unsigned long sid;
unsigned sid;
unsigned *pCID;
@@ -1606,7 +1606,11 @@ struct client *client
pchannel->ticks_at_creation = tickGet();
pchannel->addr = tmp_addr;
pchannel->client = client;
pchannel->cid = mp->m_cid;
/*
* bypass read only warning
*/
pCID = (unsigned *) &pchannel->cid;
*pCID = mp->m_cid;
/*
* allocate a server id and enter the channel pointer
@@ -1614,8 +1618,12 @@ struct client *client
*/
FASTLOCK(&rsrv_free_addrq_lck);
sid = bucketID++;
pchannel->sid = sid;
status = bucketAddItem(pCaBucket, sid, pchannel);
/*
* bypass read only warning
*/
pCID = (unsigned *) &pchannel->sid;
*pCID = sid;
status = bucketAddItemUnsignedId (pCaBucket, &pchannel->sid, pchannel);
FASTUNLOCK(&rsrv_free_addrq_lck);
if(status!=BUCKET_SUCCESS){
SEND_LOCK(client);
@@ -1905,10 +1913,11 @@ struct client *pc
*/
LOCAL struct channel_in_use *MPTOPCIU(struct extmsg *mp)
{
struct channel_in_use *pciu;
struct channel_in_use *pciu;
const unsigned id = mp->m_cid;
FASTLOCK(&rsrv_free_addrq_lck);
pciu = bucketLookupItem(pCaBucket, mp->m_cid);
pciu = bucketLookupItemUnsignedId (pCaBucket, &id);
FASTUNLOCK(&rsrv_free_addrq_lck);
return pciu;
@@ -1926,7 +1935,6 @@ LOCAL void casAccessRightsCB(ASCLIENTPVT ascpvt, asClientStatus type)
struct client *pclient;
struct channel_in_use *pciu;
struct event_ext *pevext;
int status;
pciu = asGetClientPvt(ascpvt);
assert(pciu);
-1
View File
@@ -78,7 +78,6 @@ FAST int sock;
int nchars;
FAST int status;
FAST struct client *client;
int i;
int true = TRUE;
client = NULL;
+3 -1
View File
@@ -315,7 +315,9 @@ LOCAL int terminate_one_client(struct client *client)
free(pciu->pPutNotify);
}
FASTLOCK(&rsrv_free_addrq_lck);
status = bucketRemoveItem(pCaBucket, pciu->sid, pciu);
status = bucketRemoveItemUnsignedId (
pCaBucket,
&pciu->sid);
FASTUNLOCK(&rsrv_free_addrq_lck);
if(status != BUCKET_SUCCESS){
logMsg(
+3 -2
View File
@@ -339,11 +339,12 @@ LOCAL void clean_addrq()
}
if (delay > timeout) {
int status;
ellDelete(&prsrv_cast_client->addrq, &pciu->node);
FASTLOCK(&rsrv_free_addrq_lck);
s = bucketRemoveItem(pCaBucket, pciu->sid, pciu);
s = bucketRemoveItemUnsignedId (
pCaBucket,
&pciu->sid);
if(s != BUCKET_SUCCESS){
logMsg(
"%s Bad id at close",
+14 -2
View File
@@ -45,6 +45,14 @@
static char *serverhSccsId = "@(#)server.h 1.19 5/6/94";
#if defined(CAS_VERSION_GLOBAL) && 0
# define HDRVERSIONID(NAME,VERS) VERSIONID(NAME,VERS)
#else /*CAS_VERSION_GLOBAL*/
# define HDRVERSIONID(NAME,VERS)
#endif /*CAS_VERSION_GLOBAL*/
typedef int SOCKET;
#include <vxLib.h>
#include <ellLib.h>
#include <fast_lock.h>
@@ -54,6 +62,7 @@ static char *serverhSccsId = "@(#)server.h 1.19 5/6/94";
#include <dbEvent.h>
#include <iocmsg.h>
#include <bucketLib.h>
#include <taskwd.h>
#include <asLib.h>
#include <asDbLib.h>
@@ -112,8 +121,8 @@ struct channel_in_use{
ELLLIST eventq;
struct client *client;
RSRVPUTNOTIFY *pPutNotify; /* potential active put notify */
unsigned long cid; /* client id */
unsigned long sid; /* server id */
const unsigned cid; /* client id */
const unsigned sid; /* server id */
unsigned long ticks_at_creation; /* for UDP timeout */
struct db_addr addr;
ASCLIENTPVT asClientPVT;
@@ -158,6 +167,9 @@ GLBLTYPE FAST_LOCK rsrv_free_addrq_lck;
GLBLTYPE FAST_LOCK rsrv_free_eventq_lck;
GLBLTYPE struct client *prsrv_cast_client;
GLBLTYPE BUCKET *pCaBucket;
#define CAS_HASH_TABLE_SIZE 4096
/*
* set true if max memory block drops below MAX_BLOCK_THRESHOLD
*/