summaryrefslogtreecommitdiff
path: root/protocols/MSN/msn_p2ps.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-14 19:40:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-14 19:40:31 +0000
commitdab02845fea8031dd3d7864dc1efc211a434f969 (patch)
tree5106120c4f64fbf518f57a963f5c7aec6eb19363 /protocols/MSN/msn_p2ps.cpp
parent60df08c2f6194702ec180c2d2adf20d3675edae1 (diff)
- code cleaning
- sync git-svn-id: http://svn.miranda-ng.org/main/trunk@975 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/msn_p2ps.cpp')
-rw-r--r--protocols/MSN/msn_p2ps.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/protocols/MSN/msn_p2ps.cpp b/protocols/MSN/msn_p2ps.cpp
index a274997524..a3b5965ac8 100644
--- a/protocols/MSN/msn_p2ps.cpp
+++ b/protocols/MSN/msn_p2ps.cpp
@@ -127,6 +127,24 @@ filetransfer* CMsnProto::p2p_getThreadSession(HANDLE hContact, TInfoType mType)
return result;
}
+void CMsnProto::p2p_clearThreadSessions(HANDLE hContact, TInfoType mType)
+{
+ EnterCriticalSection(&sessionLock);
+
+ for (int i=0; i < sessionList.getCount(); i++)
+ {
+ filetransfer* ft = &sessionList[i];
+ if (ft->std.hContact == hContact && ft->tType == mType)
+ {
+ ft->bCanceled = true;
+ ft->tType = SERVER_NOTIFICATION;
+ p2p_sendCancel(ft);
+ }
+ }
+
+ LeaveCriticalSection(&sessionLock);
+}
+
filetransfer* CMsnProto::p2p_getAvatarSession(HANDLE hContact)
{
EnterCriticalSection(&sessionLock);
@@ -172,7 +190,7 @@ void CMsnProto::p2p_clearDormantSessions(void)
filetransfer* FT = &sessionList[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) > 60)
+ else if (FT->p2p_waitack && (ts - FT->ts) > 120)
{
FT->bCanceled = true;
p2p_sendCancel(FT);