summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraAvatars.cpp2
-rw-r--r--protocols/MRA/src/MraConstans.h2
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp4
-rw-r--r--protocols/MRA/src/MraMRIMProxy.cpp4
-rw-r--r--protocols/MRA/src/Mra_proto.cpp24
5 files changed, 18 insertions, 18 deletions
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index d6ef6620b0..a9ae87f1b1 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -368,7 +368,7 @@ HANDLE MraAvatarsHttpConnect(HANDLE m_hNetlibUser, LPCSTR lpszHost, DWORD dwPort
nloc.wPort = ( IsHTTPSProxyUsed(m_hNetlibUser)) ? MRA_SERVER_PORT_HTTPS : dwPort;
nloc.timeout = db_get_dw(NULL, MRA_AVT_SECT_NAME, "TimeOutConnect", MRA_AVT_DEFAULT_TIMEOUT_CONN);
if (nloc.timeout < MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout > MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+ if (nloc.timeout > MRA_TIMEOUT_CONN_МAX) nloc.timeout = MRA_TIMEOUT_CONN_МAX;
DWORD dwConnectReTryCount = db_get_dw(NULL, MRA_AVT_SECT_NAME, "ConnectReTryCount", MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
DWORD dwCurConnectReTryCount = dwConnectReTryCount;
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h
index de3cb26606..525ed13cba 100644
--- a/protocols/MRA/src/MraConstans.h
+++ b/protocols/MRA/src/MraConstans.h
@@ -146,7 +146,7 @@ static const LPSTR lpcszMailRuDomains[] =
#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY 3
#define MRA_TIMEOUT_DIRECT_CONN 30 //internal; время после которого клиент считает что к нему подключится не удалось
#define MRA_TIMEOUT_CONN_MIN 2 //internal; минимальное время ожидания пока устанавливается исходящее подключение
-#define MRA_TIMEOUT_CONN_МАХ 16 //internal; максимальное время ожидания пока устанавливается исходящее подключение
+#define MRA_TIMEOUT_CONN_МAX 16 //internal; максимальное время ожидания пока устанавливается исходящее подключение
#define MRA_MAXLENOFMESSAGE 32768 //internal
#define MRA_MAXCONTACTSPERPACKET 256 //internal
#define MRA_CODE_PAGE 1251 //internal
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index 58e9fd18ea..143de7edc9 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -471,8 +471,8 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat)
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
nloc.timeout = getDword("TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+ if (nloc.timeout < MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout > MRA_TIMEOUT_CONN_МAX) nloc.timeout = MRA_TIMEOUT_CONN_МAX;
// Set up the sockaddr structure
for (size_t i = 0;i<dat->malAddrList.dwAddrCount;i++) {
diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp
index 6a84e441ec..004a625819 100644
--- a/protocols/MRA/src/MraMRIMProxy.cpp
+++ b/protocols/MRA/src/MraMRIMProxy.cpp
@@ -106,8 +106,8 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnect
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
nloc.timeout = ((MRA_TIMEOUT_DIRECT_CONN-1)/(pmmpd->malAddrList.dwAddrCount*dwConnectReTryCount));// -1 сек чтобы был запас
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+ if (nloc.timeout < MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout > MRA_TIMEOUT_CONN_МAX) nloc.timeout = MRA_TIMEOUT_CONN_МAX;
// Set up the sockaddr structure
for (size_t i = 0; i < pmmpd->malAddrList.dwAddrCount && dwRetErrorCode != NO_ERROR; i++) {
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index c1f6914e8d..0d772c45f8 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -52,8 +52,8 @@ void CMraProto::MraThreadProc(LPVOID lpParameter)
nloc.cbSize = sizeof(nloc);
nloc.flags = NLOCF_V2;
nloc.timeout = getDword("TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM);
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+ if (nloc.timeout < MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout > MRA_TIMEOUT_CONN_МAX) nloc.timeout = MRA_TIMEOUT_CONN_МAX;
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
if (MraGetNLBData(szHost, &nloc.wPort) == NO_ERROR) {
@@ -151,8 +151,8 @@ DWORD CMraProto::MraGetNLBData(CMStringA &szHost, WORD *pwPort)
nloc.wPort = getWord("ServerPort", MRA_DEFAULT_SERVER_PORT);
nloc.timeout = getDword("TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB);
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+ if (nloc.timeout < MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout > MRA_TIMEOUT_CONN_МAX) nloc.timeout = MRA_TIMEOUT_CONN_МAX;
dwCurConnectReTryCount = dwConnectReTryCount;
do {
@@ -758,7 +758,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
if (grpName) {
dwFlags |= SCBIF_GROUP_ID;
dwGroupID = MraMoveContactToGroup(hContact, -1, grpName);
- }
+ }
SetContactBasicInfoW(hContact, 0, dwFlags, buf.getDword(), dwGroupID, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, 0, 0, 0);
}
break;
@@ -823,7 +823,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
CMStringA *pmralpsFields = new CMStringA[dwFieldsNum];
CMStringA val;
- CMStringW valW;
+ CMStringW valW;
// read headers name
for (unsigned i = 0; i < dwFieldsNum; i++) {
@@ -1003,7 +1003,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
for (unsigned i = 0; i < dwFieldsNum; i++) {
CMStringA &fld = pmralpsFields[i];
if (fld == "Username") {
- buf >> val;
+ buf >> val;
mralpsUsernameValue = val;
}
else if (fld == "Domain") { // имя было уже задано ранее
@@ -1011,15 +1011,15 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
wcsncpy_s(szEmail, _A2T(mralpsUsernameValue + "@" + val), SIZEOF(szEmail));
}
else if (fld == "Nickname") {
- buf >> valW;
+ buf >> valW;
wcsncpy_s(szNick, valW, SIZEOF(szNick));
}
else if (fld == "FirstName") {
- buf >> valW;
+ buf >> valW;
wcsncpy_s(szFirstName, valW, SIZEOF(szFirstName));
}
else if (fld == "LastName") {
- buf >> valW;
+ buf >> valW;
wcsncpy_s(szLastName, valW, SIZEOF(szLastName));
}
else buf >> val;
@@ -1317,7 +1317,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
dwTemp = GetMirandaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(szSpecStatusUri), &dwXStatus);
if (bAdded) { // update user info
- SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_NICK|SCBIF_PHONES),
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_NICK|SCBIF_PHONES),
dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, NULL, &wszNick, &szCustomPhones);
// request user info from server
MraUpdateContactInfo(hContact);
@@ -1553,7 +1553,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader)
case MRIM_CS_PROXY_ACK: return CmdProxyAck(buf);
case MRIM_CS_NEW_MAIL: return CmdNewMail(buf);
case MRIM_CS_USER_BLOG_STATUS: return CmdBlogStatus(buf);
-
+
case MRIM_CS_CONNECTION_PARAMS:// Изменение параметров соединения
buf >> m_dwPingPeriod;
m_dwNextPingSendTickTime = 0; // force send ping