From f02e97e18643f1eb2bb31d67c0ba39da50eb11ce Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Mon, 17 Jan 2000 15:55:01 +0000 Subject: [PATCH] correct mistakes made in last set of changes --- src/rsrv/camessage.c | 8 ++++---- src/rsrv/caservertask.c | 8 ++++---- src/rsrv/cast_server.c | 3 +-- src/rsrv/online_notify.c | 7 +------ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index cd1653f57..b86904e9f 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -1005,14 +1005,14 @@ LOCAL void access_rights_reply(struct channel_in_use *pciu) } SEND_LOCK(pclient); - reply = (caHdr *)ALLOC_MSG(pclient, 0); + reply = (caHdr *)ALLOC_MSG(pclient, 0); assert(reply); *reply = nill_msg; - reply->m_cmmd = CA_PROTO_ACCESS_RIGHTS; + reply->m_cmmd = CA_PROTO_ACCESS_RIGHTS; reply->m_cid = pciu->cid; reply->m_available = ar; - END_MSG(pclient); + END_MSG(pclient); SEND_UNLOCK(pclient); } @@ -1440,7 +1440,7 @@ struct client *client * serialize concurrent put notifies */ while(pciu->pPutNotify->busy){ - status = semBinaryTakeTimeout(client->blockSem,1.0); + status = semBinaryTakeTimeout(client->blockSem,60.0); if(status != semTakeOK && pciu->pPutNotify->busy){ log_header("put call back time out", client, mp,0); dbNotifyCancel(&pciu->pPutNotify->dbPutNotify); diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 55d8cbfb2..688996b7b 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -397,7 +397,7 @@ LOCAL void log_one_client(struct client *client, unsigned level) TS_STAMP current; char clientHostName[256]; - ipAddrToA (&client->addr, clientHostName, sizeof(clientHostName)); + ipAddrToA (&client->addr, clientHostName, sizeof(clientHostName)); if(client->proto == IPPROTO_UDP){ pproto = "UDP"; @@ -414,8 +414,7 @@ LOCAL void log_one_client(struct client *client, unsigned level) send_delay = tsStampDiffInSeconds(¤t,&client->time_at_last_send); recv_delay = tsStampDiffInSeconds(¤t,&client->time_at_last_recv); - printf( - "%s(%s): User=\"%s\", V%d.%u, Channel Count=%d\n", + printf( "%s(%s): User=\"%s\", V%d.%u, Channel Count=%d\n", clientHostName, client->pHostName, client->pUserName, @@ -434,7 +433,8 @@ LOCAL void log_one_client(struct client *client, unsigned level) "\tUnprocessed request bytes=%lu, Undelivered response bytes=%lu, State=%s\n", client->send.stk, client->recv.cnt - client->recv.stk, - state[client->disconnect?1:0]); + state[client->disconnect?1:0]); + } if (level>=2u) { diff --git a/src/rsrv/cast_server.c b/src/rsrv/cast_server.c index bf9dee0e2..8078e66a6 100644 --- a/src/rsrv/cast_server.c +++ b/src/rsrv/cast_server.c @@ -305,8 +305,7 @@ LOCAL void clean_addrq() while( (pciu = pnextciu) ) { pnextciu = (struct channel_in_use *)pciu->node.next; - delay = tsStampDiffInSeconds(&pciu->time_at_creation, - ¤t); + delay = tsStampDiffInSeconds(¤t,&pciu->time_at_creation); if (delay > timeout) { ellDelete(&prsrv_cast_client->addrq, &pciu->node); diff --git a/src/rsrv/online_notify.c b/src/rsrv/online_notify.c index f954e0bc1..d82b5738e 100644 --- a/src/rsrv/online_notify.c +++ b/src/rsrv/online_notify.c @@ -54,10 +54,6 @@ static char *sccsId = "@(#) $Id$"; #include "envDefs.h" #include "server.h" -LOCAL powerOfTwo[10] = { -2.0,4.0,8.0,16.0,32.0,64.0,128.0,256.0,512.0,1024.0 -}; - /* * RSRV_ONLINE_NOTIFY_TASK */ @@ -76,7 +72,6 @@ int rsrv_online_notify_task() SOCKET sock; int true = TRUE; unsigned short port; - int indPowerofTwo = 0; taskwdInsert(threadGetIdSelf(),NULL,NULL); @@ -181,7 +176,7 @@ int rsrv_online_notify_task() pNode = (caAddrNode *)pNode->node.next; } threadSleep(delay); - delay = delay + powerOfTwo[indPowerofTwo++]; + delay *= 2.0; if(delay>=maxdelay) delay = maxdelay; } }