diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index bf24dffe4..30b301ba9 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -190,6 +190,8 @@ LOCAL void *casCalloc (size_t count, size_t size); LOCAL void *casMalloc (size_t size); +LOCAL unsigned nextRsrvResourceID; + /* * CAMESSAGE() @@ -1746,7 +1748,6 @@ struct dbAddr *pAddr, unsigned cid ) { - static unsigned bucketID; unsigned *pCID; struct channel_in_use *pchannel; int status; @@ -1783,7 +1784,7 @@ unsigned cid * bypass read only warning */ pCID = (unsigned *) &pchannel->sid; - *pCID = bucketID++; + *pCID = nextRsrvResourceID++; /* * Verify that this id is not in use @@ -2201,3 +2202,10 @@ LOCAL void *casMalloc(size_t size) return malloc(size); } +/* + * getNextRsrvResourceID() + */ +unsigned getNextRsrvResourceID() +{ + return nextRsrvResourceID; +} \ No newline at end of file diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 831bf617d..e5b5d00c3 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -477,6 +477,8 @@ void casr (unsigned level) freeListItemsAvail (rsrvChanFreeList), freeListItemsAvail (rsrvEventFreeList)); + printf ("The next resource ID allocated will be %u\n", getNextRsrvResourceID()); + if(pCaBucket){ printf( "The server's resource id conversion table:\n"); FASTLOCK(&clientQlock); diff --git a/src/rsrv/server.h b/src/rsrv/server.h index 10ba70eaf..db1e14a52 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -295,6 +295,8 @@ struct client *pc void write_notify_reply(void *pArg); +unsigned getNextRsrvResourceID(); + /* * !!KLUDGE!! *