summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_p2ps.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-19 22:04:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-19 22:04:33 +0000
commit25c307a140104c3b09fecbbf2f452368090a45d0 (patch)
tree99d8e24d70a0c70e37ee85339fcb348473d52bf3 /protocols/MSN/src/msn_p2ps.cpp
parent550c3e26b321ffb138d02f02c22e64f3e3044767 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11025 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_p2ps.cpp')
-rw-r--r--protocols/MSN/src/msn_p2ps.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/protocols/MSN/src/msn_p2ps.cpp b/protocols/MSN/src/msn_p2ps.cpp
index 372dbc9132..f7840374c8 100644
--- a/protocols/MSN/src/msn_p2ps.cpp
+++ b/protocols/MSN/src/msn_p2ps.cpp
@@ -28,8 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CMsnProto::p2p_registerSession(filetransfer* ft)
{
- mir_cslock lck(sessionLock);
- sessionList.insert(ft);
+ mir_cslock lck(m_csSessions);
+ m_arSessions.insert(ft);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -37,8 +37,8 @@ void CMsnProto::p2p_registerSession(filetransfer* ft)
void CMsnProto::p2p_unregisterSession(filetransfer* ft)
{
- mir_cslock lck(sessionLock);
- sessionList.remove(ft);
+ mir_cslock lck(m_csSessions);
+ m_arSessions.remove(ft);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -49,10 +49,10 @@ filetransfer* CMsnProto::p2p_getSessionByID(unsigned id)
if (id == 0)
return NULL;
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (FT->p2p_sessionid == id)
return FT;
}
@@ -65,10 +65,10 @@ filetransfer* CMsnProto::p2p_getSessionByUniqueID(unsigned id)
if (id == 0)
return NULL;
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (FT->p2p_acksessid == id)
return FT;
}
@@ -82,16 +82,16 @@ bool CMsnProto::p2p_sessionRegistered(filetransfer* ft)
if (ft != NULL && ft->p2p_appID == 0)
return true;
- mir_cslock lck(sessionLock);
- return sessionList.getIndex(ft) > -1;
+ mir_cslock lck(m_csSessions);
+ return m_arSessions.getIndex(ft) > -1;
}
filetransfer* CMsnProto::p2p_getThreadSession(MCONTACT hContact, TInfoType mType)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (FT->std.hContact == hContact && FT->tType == mType)
return FT;
}
@@ -101,10 +101,10 @@ filetransfer* CMsnProto::p2p_getThreadSession(MCONTACT hContact, TInfoType mType
void CMsnProto::p2p_clearThreadSessions(MCONTACT hContact, TInfoType mType)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* ft = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* ft = &m_arSessions[i];
if (ft->std.hContact == hContact && ft->tType == mType) {
ft->bCanceled = true;
ft->tType = SERVER_NOTIFICATION;
@@ -115,10 +115,10 @@ void CMsnProto::p2p_clearThreadSessions(MCONTACT hContact, TInfoType mType)
filetransfer* CMsnProto::p2p_getAvatarSession(MCONTACT hContact)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (FT->std.hContact == hContact && !(FT->std.flags & PFTS_SENDING) && FT->p2p_type == MSN_APPID_AVATAR)
return FT;
}
@@ -128,11 +128,11 @@ filetransfer* CMsnProto::p2p_getAvatarSession(MCONTACT hContact)
bool CMsnProto::p2p_isAvatarOnly(MCONTACT hContact)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
bool result = true;
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
result &= FT->std.hContact != hContact || FT->p2p_type != MSN_APPID_FILE;
}
@@ -141,11 +141,11 @@ bool CMsnProto::p2p_isAvatarOnly(MCONTACT hContact)
void CMsnProto::p2p_clearDormantSessions(void)
{
- mir_cslockfull lck(sessionLock);
+ mir_cslockfull lck(m_csSessions);
time_t ts = time(NULL);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (!FT->p2p_sessionid && !MSN_GetUnconnectedThread(FT->p2p_dest, SERVER_P2P_DIRECT))
p2p_invite(FT->p2p_type, FT, NULL);
else if (FT->p2p_waitack && (ts - FT->ts) > 120) {
@@ -161,11 +161,11 @@ void CMsnProto::p2p_clearDormantSessions(void)
void CMsnProto::p2p_redirectSessions(const char *wlid)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
ThreadData* T = MSN_GetP2PThreadByContact(wlid);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (_stricmp(FT->p2p_dest, wlid) == 0 &&
FT->std.currentFileProgress < FT->std.currentFileSize &&
(T == NULL || (FT->tType != T->mType && FT->tType != 0))) {
@@ -183,13 +183,13 @@ void CMsnProto::p2p_redirectSessions(const char *wlid)
void CMsnProto::p2p_startSessions(const char* wlid)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
char* szEmail;
parseWLID(NEWSTR_ALLOCA(wlid), NULL, &szEmail, NULL);
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (!FT->bAccepted && !_stricmp(FT->p2p_dest, szEmail)) {
if (FT->p2p_appID == MSN_APPID_FILE && (FT->std.flags & PFTS_SENDING))
p2p_invite(FT->p2p_type, FT, wlid);
@@ -201,11 +201,11 @@ void CMsnProto::p2p_startSessions(const char* wlid)
void CMsnProto::p2p_cancelAllSessions(void)
{
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < sessionList.getCount(); i++) {
- sessionList[i].bCanceled = true;
- p2p_sendCancel(&sessionList[i]);
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ m_arSessions[i].bCanceled = true;
+ p2p_sendCancel(&m_arSessions[i]);
}
}
@@ -214,11 +214,11 @@ filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char*
if (CallID == NULL)
return NULL;
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
char* szEmail = NULL;
- for (int i = 0; i < sessionList.getCount(); i++) {
- filetransfer* FT = &sessionList[i];
+ for (int i = 0; i < m_arSessions.getCount(); i++) {
+ filetransfer* FT = &m_arSessions[i];
if (FT->p2p_callID && !_stricmp(FT->p2p_callID, CallID)) {
if (_stricmp(FT->p2p_dest, wlid)) {
if (!szEmail)
@@ -236,14 +236,14 @@ filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char*
void CMsnProto::p2p_registerDC(directconnection* dc)
{
- mir_cslock lck(sessionLock);
- dcList.insert(dc);
+ mir_cslock lck(m_csSessions);
+ m_arDirect.insert(dc);
}
void CMsnProto::p2p_unregisterDC(directconnection* dc)
{
- mir_cslock lck(sessionLock);
- dcList.remove(dc);
+ mir_cslock lck(m_csSessions);
+ m_arDirect.remove(dc);
}
directconnection* CMsnProto::p2p_getDCByCallID(const char* CallID, const char* wlid)
@@ -251,10 +251,10 @@ directconnection* CMsnProto::p2p_getDCByCallID(const char* CallID, const char* w
if (CallID == NULL)
return NULL;
- mir_cslock lck(sessionLock);
+ mir_cslock lck(m_csSessions);
- for (int i = 0; i < dcList.getCount(); i++) {
- directconnection* DC = &dcList[i];
+ for (int i = 0; i < m_arDirect.getCount(); i++) {
+ directconnection* DC = &m_arDirect[i];
if (DC->callId != NULL && !strcmp(DC->callId, CallID) && !strcmp(DC->wlid, wlid))
return DC;
}
@@ -267,7 +267,7 @@ directconnection* CMsnProto::p2p_getDCByCallID(const char* CallID, const char* w
void CMsnProto::P2pSessions_Uninit(void)
{
- mir_cslock lck(sessionLock);
- sessionList.destroy();
- dcList.destroy();
+ mir_cslock lck(m_csSessions);
+ m_arSessions.destroy();
+ m_arDirect.destroy();
}