|
@@ -208,7 +208,7 @@ public:
|
|
CLCLockBlock(ReadWriteLock &_lock, bool readLock, unsigned timeout, const char *fname, unsigned _lnum) : lock(_lock), lnum(_lnum)
|
|
CLCLockBlock(ReadWriteLock &_lock, bool readLock, unsigned timeout, const char *fname, unsigned _lnum) : lock(_lock), lnum(_lnum)
|
|
{
|
|
{
|
|
got = msTick();
|
|
got = msTick();
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (readLock)
|
|
if (readLock)
|
|
{
|
|
{
|
|
@@ -699,7 +699,7 @@ public:
|
|
const char *nextSep = path+1;
|
|
const char *nextSep = path+1;
|
|
StringBuffer head;
|
|
StringBuffer head;
|
|
depth = 1; // root
|
|
depth = 1; // root
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
nextSep = queryHead(nextSep, head.clear());
|
|
nextSep = queryHead(nextSep, head.clear());
|
|
++depth; // inc last
|
|
++depth; // inc last
|
|
@@ -707,7 +707,7 @@ public:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
StringBuffer strippedXpath;
|
|
StringBuffer strippedXpath;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
const char *startQ;
|
|
const char *startQ;
|
|
if (NULL == (startQ = queryNextUnquoted(path, '['))) // escaped '[]' chars??
|
|
if (NULL == (startQ = queryNextUnquoted(path, '['))) // escaped '[]' chars??
|
|
@@ -717,7 +717,7 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
const char *nextSep = path+1;
|
|
const char *nextSep = path+1;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
nextSep = queryHead(nextSep, head.clear());
|
|
nextSep = queryHead(nextSep, head.clear());
|
|
if (!nextSep || startQ < nextSep)
|
|
if (!nextSep || startQ < nextSep)
|
|
@@ -728,7 +728,7 @@ public:
|
|
|
|
|
|
Owned<CQualifiers> qualifiers = new CQualifiers;
|
|
Owned<CQualifiers> qualifiers = new CQualifiers;
|
|
strippedXpath.append(startQ-path, path);
|
|
strippedXpath.append(startQ-path, path);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
const char *endQ = queryNextUnquoted(startQ+1, ']');
|
|
const char *endQ = queryNextUnquoted(startQ+1, ']');
|
|
if (!endQ)
|
|
if (!endQ)
|
|
@@ -776,7 +776,7 @@ public:
|
|
const char *qualifier = qualifiers->item(q2);
|
|
const char *qualifier = qualifiers->item(q2);
|
|
const char *q = qualifier;
|
|
const char *q = qualifier;
|
|
bool numeric = true;
|
|
bool numeric = true;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if ('\0' == *q) break;
|
|
if ('\0' == *q) break;
|
|
else if (!isdigit(*q)) { numeric = false; break; }
|
|
else if (!isdigit(*q)) { numeric = false; break; }
|
|
@@ -921,7 +921,7 @@ void serializeVisibleAttributes(IPropertyTree &tree, MemoryBuffer &mb)
|
|
IAttributeIterator *aIter = tree.getAttributes();
|
|
IAttributeIterator *aIter = tree.getAttributes();
|
|
if (aIter->first())
|
|
if (aIter->first())
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
const char *attr = aIter->queryName();
|
|
const char *attr = aIter->queryName();
|
|
if (0 != strcmp(EXT_ATTR, attr))
|
|
if (0 != strcmp(EXT_ATTR, attr))
|
|
@@ -947,7 +947,7 @@ void writeDelta(StringBuffer &xml, IFile &iFile, const char *msg="", unsigned re
|
|
unsigned startCrc = ~0;
|
|
unsigned startCrc = ~0;
|
|
MemoryBuffer header;
|
|
MemoryBuffer header;
|
|
char strNum[17];
|
|
char strNum[17];
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
header.append(deltaHeader);
|
|
header.append(deltaHeader);
|
|
try
|
|
try
|
|
@@ -1058,7 +1058,7 @@ class CBackupHandler : public CInterface, implements IThreaded
|
|
}
|
|
}
|
|
void clearQueue(BackupQueue &queue)
|
|
void clearQueue(BackupQueue &queue)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
BackupQueueItem *item = queue.dequeue();
|
|
BackupQueueItem *item = queue.dequeue();
|
|
if (!item) break;
|
|
if (!item) break;
|
|
@@ -1070,7 +1070,7 @@ class CBackupHandler : public CInterface, implements IThreaded
|
|
Owned<IException> exception;
|
|
Owned<IException> exception;
|
|
unsigned _retryAttempts = retryAttempts;
|
|
unsigned _retryAttempts = retryAttempts;
|
|
StringBuffer rL(remoteBackupLocation);
|
|
StringBuffer rL(remoteBackupLocation);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -1104,7 +1104,7 @@ class CBackupHandler : public CInterface, implements IThreaded
|
|
Owned<IException> exception;
|
|
Owned<IException> exception;
|
|
unsigned _retryAttempts = retryAttempts;
|
|
unsigned _retryAttempts = retryAttempts;
|
|
StringBuffer rL(remoteBackupLocation);
|
|
StringBuffer rL(remoteBackupLocation);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -1145,7 +1145,7 @@ class CBackupHandler : public CInterface, implements IThreaded
|
|
void clearOld()
|
|
void clearOld()
|
|
{
|
|
{
|
|
CriticalBlock b(queueCrit);
|
|
CriticalBlock b(queueCrit);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
BackupQueueItem *item = itemQueue.dequeue();
|
|
BackupQueueItem *item = itemQueue.dequeue();
|
|
if (!item) break;
|
|
if (!item) break;
|
|
@@ -1312,7 +1312,7 @@ public:
|
|
// IThreaded
|
|
// IThreaded
|
|
void main()
|
|
void main()
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
BackupQueueItem *item=NULL;
|
|
BackupQueueItem *item=NULL;
|
|
do
|
|
do
|
|
@@ -1739,7 +1739,7 @@ void buildNotifyData(MemoryBuffer ¬ifyData, PDState state, CPTStack *stack, M
|
|
if (n>1)
|
|
if (n>1)
|
|
{
|
|
{
|
|
unsigned s = 1;
|
|
unsigned s = 1;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
PTree &child = stack->item(s);
|
|
PTree &child = stack->item(s);
|
|
const char *str = child.queryName();
|
|
const char *str = child.queryName();
|
|
@@ -1801,7 +1801,7 @@ public:
|
|
|
|
|
|
void notify()
|
|
void notify()
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (!subscriber.notify(change->notifyData))
|
|
if (!subscriber.notify(change->notifyData))
|
|
{
|
|
{
|
|
@@ -2205,7 +2205,7 @@ StringBuffer &CPTStack::getAbsolutePath(StringBuffer &str)
|
|
if (ordinality()>1)
|
|
if (ordinality()>1)
|
|
{
|
|
{
|
|
unsigned i = 1;
|
|
unsigned i = 1;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
IPropertyTree *child = &item(i);
|
|
IPropertyTree *child = &item(i);
|
|
str.append(child->queryName());
|
|
str.append(child->queryName());
|
|
@@ -2284,7 +2284,7 @@ void CRemoteTreeBase::deserializeRT(MemoryBuffer &src)
|
|
void CRemoteTreeBase::deserializeChildrenRT(MemoryBuffer &src)
|
|
void CRemoteTreeBase::deserializeChildrenRT(MemoryBuffer &src)
|
|
{
|
|
{
|
|
StringAttr eName;
|
|
StringAttr eName;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
size32_t pos = src.getPos();
|
|
size32_t pos = src.getPos();
|
|
src.read(eName);
|
|
src.read(eName);
|
|
@@ -3295,7 +3295,7 @@ class CLock : implements IInterface, public CInterface
|
|
{
|
|
{
|
|
if (INFINITE == timeout)
|
|
if (INFINITE == timeout)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (!SDSManager->queryConnection(id))
|
|
if (!SDSManager->queryConnection(id))
|
|
return LockFailed;
|
|
return LockFailed;
|
|
@@ -3334,7 +3334,7 @@ class CLock : implements IInterface, public CInterface
|
|
else
|
|
else
|
|
{
|
|
{
|
|
CTimeMon tm(timeout);
|
|
CTimeMon tm(timeout);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (!SDSManager->queryConnection(id))
|
|
if (!SDSManager->queryConnection(id))
|
|
return LockFailed;
|
|
return LockFailed;
|
|
@@ -3905,7 +3905,7 @@ bool checkOldFormat(CServerRemoteTree *parentServerTree, IPropertyTree *tree, Me
|
|
{
|
|
{
|
|
if (CPS_Renames & state)
|
|
if (CPS_Renames & state)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
__int64 id;
|
|
__int64 id;
|
|
mb.read(id);
|
|
mb.read(id);
|
|
@@ -3936,7 +3936,7 @@ bool checkOldFormat(CServerRemoteTree *parentServerTree, IPropertyTree *tree, Me
|
|
|
|
|
|
if (CPS_Deletions & state)
|
|
if (CPS_Deletions & state)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
__int64 id;
|
|
__int64 id;
|
|
mb.read(id);
|
|
mb.read(id);
|
|
@@ -4026,7 +4026,7 @@ bool translateOldFormat(CServerRemoteTree *parentServerTree, IPropertyTree *pare
|
|
mb.read(hasChildren);
|
|
mb.read(hasChildren);
|
|
if (hasChildren)
|
|
if (hasChildren)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
__int64 id;
|
|
__int64 id;
|
|
int pos = -1;
|
|
int pos = -1;
|
|
@@ -4272,7 +4272,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
|
|
replyMb.init(mb.getSender(), mb.getTag(), mb.getReplyTag());
|
|
replyMb.init(mb.getSender(), mb.getTag(), mb.getReplyTag());
|
|
replyMb.append((int)DAMP_SDSREPLY_OK);
|
|
replyMb.append((int)DAMP_SDSREPLY_OK);
|
|
bool first = true, empty = false;
|
|
bool first = true, empty = false;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
mb.read(serverId);
|
|
mb.read(serverId);
|
|
if (!serverId) break;
|
|
if (!serverId) break;
|
|
@@ -4698,7 +4698,7 @@ public:
|
|
static bool retryRename(const char *from, const char *to, unsigned maxAttempts, unsigned delay)
|
|
static bool retryRename(const char *from, const char *to, unsigned maxAttempts, unsigned delay)
|
|
{
|
|
{
|
|
unsigned attempts=maxAttempts;
|
|
unsigned attempts=maxAttempts;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
OwnedIFile iFile = createIFile(from);
|
|
OwnedIFile iFile = createIFile(from);
|
|
try
|
|
try
|
|
@@ -4723,7 +4723,7 @@ static bool retryRename(const char *from, const char *to, unsigned maxAttempts,
|
|
static bool retryCopy(const char *from, const char *to, unsigned maxAttempts, unsigned delay)
|
|
static bool retryCopy(const char *from, const char *to, unsigned maxAttempts, unsigned delay)
|
|
{
|
|
{
|
|
unsigned attempts=maxAttempts;
|
|
unsigned attempts=maxAttempts;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
StringBuffer _from;
|
|
StringBuffer _from;
|
|
StringBuffer fname;
|
|
StringBuffer fname;
|
|
@@ -5074,7 +5074,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface
|
|
Owned<IDirectoryIterator> dIter = createDirectoryIterator(location, wcard.str());
|
|
Owned<IDirectoryIterator> dIter = createDirectoryIterator(location, wcard.str());
|
|
ForEach (*dIter)
|
|
ForEach (*dIter)
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try { dIter->query().remove(); break; }
|
|
try { dIter->query().remove(); break; }
|
|
catch (IException *e)
|
|
catch (IException *e)
|
|
@@ -5094,7 +5094,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface
|
|
StringBuffer path(location);
|
|
StringBuffer path(location);
|
|
path.append(storeInfo->cache);
|
|
path.append(storeInfo->cache);
|
|
OwnedIFile iFile = createIFile(path.str());
|
|
OwnedIFile iFile = createIFile(path.str());
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try { iFile->remove(); break; }
|
|
try { iFile->remove(); break; }
|
|
catch (IException *e)
|
|
catch (IException *e)
|
|
@@ -5155,7 +5155,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface
|
|
wcard.append(base).append(".*");
|
|
wcard.append(base).append(".*");
|
|
Owned<IDirectoryIterator> dIter = createDirectoryIterator(location, wcard.str());
|
|
Owned<IDirectoryIterator> dIter = createDirectoryIterator(location, wcard.str());
|
|
unsigned totalDelays = 0;
|
|
unsigned totalDelays = 0;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (dIter->first())
|
|
if (dIter->first())
|
|
{
|
|
{
|
|
@@ -5250,7 +5250,7 @@ class CStoreHelper : implements IStoreHelper, public CInterface
|
|
if (detachIPIFile)
|
|
if (detachIPIFile)
|
|
{
|
|
{
|
|
unsigned a=0;
|
|
unsigned a=0;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try { detachIPIFile->remove(); break; }
|
|
try { detachIPIFile->remove(); break; }
|
|
catch (IException *e)
|
|
catch (IException *e)
|
|
@@ -5407,7 +5407,7 @@ public:
|
|
OwnedIFile detachedDeltaIFile = createIFile(getDetachedDeltaName(detachPath).str());
|
|
OwnedIFile detachedDeltaIFile = createIFile(getDetachedDeltaName(detachPath).str());
|
|
bool detached = detachedDeltaIFile->exists();
|
|
bool detached = detachedDeltaIFile->exists();
|
|
OwnedIFile deltaIFile = createIFile(deltaFilename.str());
|
|
OwnedIFile deltaIFile = createIFile(deltaFilename.str());
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
StringAttr filename;
|
|
StringAttr filename;
|
|
IFile *iFile;
|
|
IFile *iFile;
|
|
@@ -6077,7 +6077,7 @@ void CCovenSDSManager::loadStore(const char *storeName, const bool *abort)
|
|
unsigned l = strlen(EXTERNAL_NAME_PREFIX);
|
|
unsigned l = strlen(EXTERNAL_NAME_PREFIX);
|
|
bool primary = true;
|
|
bool primary = true;
|
|
Owned<IDirectoryIterator> di = createDirectoryIterator(dataPath);
|
|
Owned<IDirectoryIterator> di = createDirectoryIterator(dataPath);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -6133,7 +6133,7 @@ void CCovenSDSManager::loadStore(const char *storeName, const bool *abort)
|
|
IExternalHandler *extHandler = queryExternalHandler(EF_BinaryValue);
|
|
IExternalHandler *extHandler = queryExternalHandler(EF_BinaryValue);
|
|
primary = true;
|
|
primary = true;
|
|
UInt64Array missingPrimarys;
|
|
UInt64Array missingPrimarys;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
UInt64Array &fileExts = primary ? primaryExts : backupExts;
|
|
UInt64Array &fileExts = primary ? primaryExts : backupExts;
|
|
unsigned __int64 refN = refExts.ordinality() ? refExts.item(0) : (unsigned __int64)-1;
|
|
unsigned __int64 refN = refExts.ordinality() ? refExts.item(0) : (unsigned __int64)-1;
|
|
@@ -6406,7 +6406,7 @@ StringBuffer &transformToAbsolute(StringBuffer &result, const char *xpath, unsig
|
|
const char *end = xpath+strlen(xpath);
|
|
const char *end = xpath+strlen(xpath);
|
|
const char *p = end;
|
|
const char *p = end;
|
|
const char *q = NULL;
|
|
const char *q = NULL;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (p == xpath)
|
|
if (p == xpath)
|
|
{
|
|
{
|
|
@@ -7205,7 +7205,7 @@ CServerConnection *CCovenSDSManager::createConnectionInstance(CRemoteTreeBase *r
|
|
uProp.append(prop).append('-');
|
|
uProp.append(prop).append('-');
|
|
unsigned l = uProp.length();
|
|
unsigned l = uProp.length();
|
|
unsigned n=1;
|
|
unsigned n=1;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
n += getRandom() % 5; // better chance of finding a mismatch soon.
|
|
n += getRandom() % 5; // better chance of finding a mismatch soon.
|
|
uProp.append(n);
|
|
uProp.append(n);
|
|
@@ -7298,7 +7298,7 @@ CServerConnection *CCovenSDSManager::createConnectionInstance(CRemoteTreeBase *r
|
|
connection->queryPTreePath().getAbsolutePath(headPath);
|
|
connection->queryPTreePath().getAbsolutePath(headPath);
|
|
if (headPath.length() && headPath.charAt(0) == '/')
|
|
if (headPath.length() && headPath.charAt(0) == '/')
|
|
headPath.remove(0, 1);
|
|
headPath.remove(0, 1);
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
_deltaPath.append('/');
|
|
_deltaPath.append('/');
|
|
IPropertyTree &tree = connection->queryPTreePath().item(s);
|
|
IPropertyTree &tree = connection->queryPTreePath().item(s);
|
|
@@ -7596,7 +7596,7 @@ void CCovenSDSManager::createConnection(SessionId sessionId, unsigned mode, unsi
|
|
freeExistingLocks.setConnectionId(connectionId);
|
|
freeExistingLocks.setConnectionId(connectionId);
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -8260,7 +8260,7 @@ public:
|
|
SubCommitType match(const char *head, const char *path)
|
|
SubCommitType match(const char *head, const char *path)
|
|
{
|
|
{
|
|
bool wild = false;
|
|
bool wild = false;
|
|
- loop
|
|
|
|
|
|
+ for (;;)
|
|
{
|
|
{
|
|
if (wild)
|
|
if (wild)
|
|
{
|
|
{
|