summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2016-06-17 07:59:10 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2016-06-17 07:59:10 +0000
commit1d3ab2a60e0a0ad1410b47c14897e9ebd3fcb994 (patch)
treef101fb9a4c0b9959eb6b6dc2a290f5638a0c012c /protocols
parent9d61c6b4cfbf9b8bb7c00dbaa625b0489021a3ca (diff)
MRA: fix connection issue
git-svn-id: http://svn.miranda-ng.org/main/trunk@16998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/MRA/src/Mra_proto.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 587fdf57da..7ece81f274 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -209,7 +209,7 @@ DWORD CMraProto::MraNetworkDispatcher()
mrim_packet_header_t *pmaHeader;
NETLIBSELECT nls = { sizeof(nls) };
- nls.dwTimeout = 1000;
+ nls.dwTimeout = 30000;
nls.hReadConns[0] = m_hConnection;
lpbBufferRcv = (LPBYTE)mir_calloc(dwRcvBuffSize);
@@ -217,7 +217,6 @@ DWORD CMraProto::MraNetworkDispatcher()
m_dwNextPingSendTickTime = m_dwPingPeriod = MAXDWORD;
dwCMDNum = 0;
MraSendCMD(MRIM_CS_HELLO, NULL, 0);
- m_dwThreadWorkerLastPingTime = GetTickCount();
while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
DWORD dwSelectRet = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
if (SOCKET_ERROR == dwSelectRet) {
@@ -235,7 +234,8 @@ DWORD CMraProto::MraNetworkDispatcher()
m_dwNextPingSendTickTime = (m_dwThreadWorkerLastPingTime + nls.dwTimeout);
MraSendCMD(MRIM_CS_PING, NULL, 0);
} else {
- nls.dwTimeout = (m_dwNextPingSendTickTime - m_dwThreadWorkerLastPingTime);
+ if (MAXDWORD != m_dwNextPingSendTickTime)
+ nls.dwTimeout = (m_dwNextPingSendTickTime - m_dwThreadWorkerLastPingTime);
}
{ /* Remove old items from send queue. */
DWORD dwCmdNum, dwFlags, dwAckType;