small cosmetic changes in spacing.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@24214 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Dave Wetzel 2006-12-19 12:16:57 +00:00
parent 2f2a13fc47
commit 126006dd58

View file

@ -71,7 +71,7 @@ GSWLoadBalancing_FindApp(GSWAppRequest *p_pAppRequest,
GSWAppInstance *pAppInstance=NULL;
time_t curTime = (time_t)0;
while (!fFound && iTries-->0)
while (!fFound && ((iTries--) > 0))
{
pApp->iLastInstanceIndex = (pApp->iLastInstanceIndex+1) % uInstancesCount;
GSWDebugLog(p_pLogServerData,"LoadBalancing: Will try instance %d (instances count=%d).",
@ -103,6 +103,7 @@ GSWLoadBalancing_FindApp(GSWAppRequest *p_pAppRequest,
pAppInstance->timeNextRetryTime=0;
};
};
if (pAppInstance->timeNextRetryTime==0 && pAppInstance->fValid)
{
BOOL okay = TRUE;
@ -140,11 +141,11 @@ GSWLoadBalancing_FindApp(GSWAppRequest *p_pAppRequest,
p_pAppRequest->pAppInstance = pAppInstance;
pAppInstance->uOpenedRequestsNb++;
}
};
};
};
}
}
}
GSWList_Free(pInstancesList,FALSE);
};
}
GSWLock_Unlock(g_lockAppList);
if (fFound)
@ -184,9 +185,10 @@ GSWLoadBalancing_FindInstance(GSWAppRequest *p_pAppRequest,
{
GSWAppInstance *pAppInstance = NULL;
char szInstanceNum[50] = "";
sprintf(szInstanceNum,"%d",p_pAppRequest->iInstance);
pAppInstance =
(GSWAppInstance *)GSWDict_ValueForKey(&pApp->stInstancesDict,
pAppInstance = (GSWAppInstance *)GSWDict_ValueForKey(&pApp->stInstancesDict,
szInstanceNum);
// Not a known instance
@ -197,25 +199,25 @@ GSWLoadBalancing_FindInstance(GSWAppRequest *p_pAppRequest,
fFound=GSWLoadBalancing_FindApp(p_pAppRequest,
p_pLogServerData,
p_pURLComponents);
}
else
{
} else {
GSWDebugLog(p_pLogServerData,"Instance Found");
if (pAppInstance->fValid)
{
BOOL okay = TRUE;
// check if refused, time to try again ?
if (p_pURLComponents->stRequestHandlerKey.iLength==0 ||
p_pURLComponents->stRequestHandlerKey.pszStart==NULL)
if (p_pURLComponents->stRequestHandlerKey.iLength==0 || p_pURLComponents->stRequestHandlerKey.pszStart==NULL)
{
GSWAppInfo *thisAppInfo =
GSWAppInfo_Find(p_pAppRequest->pszName,
pAppInstance->iInstance);
if (thisAppInfo && thisAppInfo->isRefused)
{
time_t actTime = (time_t)0;
// this instance refuses new sessions
time(&actTime);
if (actTime > thisAppInfo->timeNextRetryTime)
{
thisAppInfo->isRefused = FALSE; // try it again
@ -238,20 +240,18 @@ GSWLoadBalancing_FindInstance(GSWAppRequest *p_pAppRequest,
pAppInstance->uOpenedRequestsNb++;
GSWDebugLog(p_pLogServerData,"Instance is valid");
}
}
else
{
} else {
GSWDebugLog(p_pLogServerData,"Instance is not valid");
};
};
};
}
}
}
GSWLock_Unlock(g_lockAppList);
GSWDebugLog(p_pLogServerData,"Stop GSWLoadBalancing_FindInstance");
return fFound;
};
}
//--------------------------------------------------------------------
void