summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-06 21:27:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-06 21:27:20 +0000
commita19a07312430e3b61f8d80b72d7a3c58def02710 (patch)
treecf11acb9ea0394eff273d212062610324aa5c172
parent6185658d9b0da52d35622b63b02771bb72277982 (diff)
more correct form of cycle
git-svn-id: http://svn.miranda-ng.org/main/trunk@12361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index b5f49ee611..147d16a898 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -552,17 +552,17 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid,
if (m_avatarsConnection && m_avatarsConnection->isReady()) { // check if we are ready
// check if requests for this user are not blocked
- for (avatars_request *ar = m_avatarsQueue; ar; ar = ar->pNext) {
+ for (avatars_request *ar = m_avatarsQueue; ar; ) {
if (ar->hContact == hContact && ar->type == ART_BLOCK) { // found a block item
if (GetTickCount() > ar->timeOut) { // remove timeouted block
- if ((ar = ReleaseAvatarRequestInQueue(ar)) == NULL)
- break;
+ ar = ReleaseAvatarRequestInQueue(ar);
continue;
}
m_avatarsMutex->Leave();
debugLogA("Avatars: Requests for %s avatar are blocked.", strUID(dwUin, pszUid));
return 0;
}
+ ar = ar->pNext;
}
avatars_server_connection *pConnection = m_avatarsConnection;
@@ -582,11 +582,10 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid,
// we failed to send request, or avatar thread not ready
// check if any request for this user is not already in the queue
- for (avatars_request *ar = m_avatarsQueue; ar; ar = ar->pNext) {
+ for (avatars_request *ar = m_avatarsQueue; ar; ) {
if (ar->hContact == hContact) { // we found it, return error
if (ar->type == ART_BLOCK && GetTickCount() > ar->timeOut) { // remove timeouted block
- if ((ar = ReleaseAvatarRequestInQueue(ar)) == NULL)
- break;
+ ar = ReleaseAvatarRequestInQueue(ar);
continue;
}
m_avatarsMutex->Leave();
@@ -596,6 +595,7 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid,
requestAvatarConnection();
return 0;
}
+ ar = ar->pNext;
}
// add request to queue, processed after successful login