diff options
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 3 | ||||
-rw-r--r-- | protocols/MRA/src/MraMRIMProxy.cpp | 3 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 9 |
4 files changed, 7 insertions, 12 deletions
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 2979323977..20d7cb9770 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -157,8 +157,6 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) INTERNET_TIME itAvatarLastModifiedTimeServer;
WCHAR szErrorText[2048];
- nls.cbSize = sizeof(nls);
-
Thread_SetName("MRA: AvatarsThreadProc");
HANDLE hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
@@ -256,7 +254,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) nls.hReadConns[0] = hConnection;
while (bContinue) {
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ switch (Netlib_Select(&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwErrorCode = GetLastError();
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index bad116e95e..9b062e46c7 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -729,7 +729,6 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) bFailed = TRUE;
bConnected = FALSE;
- nls.cbSize = sizeof(nls);
pfts.cbSize = sizeof(pfts);
pfts.hContact = dat->hContact;
pfts.flags = (PFTS_RECEIVING | PFTS_UNICODE);// pfts.sending = dat->bSending; //true if sending, false if receiving
@@ -818,7 +817,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
while (bContinue) {
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ switch (Netlib_Select(&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwRetErrorCode = GetLastError();
diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp index 2953356770..f29fd6e0e8 100644 --- a/protocols/MRA/src/MraMRIMProxy.cpp +++ b/protocols/MRA/src/MraMRIMProxy.cpp @@ -126,7 +126,6 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnect while (--dwCurConnectReTryCount && pmmpd->hConnection == NULL);
if (pmmpd->hConnection) {
- nls.cbSize = sizeof(nls);
nls.dwTimeout = (MRA_TIMEOUT_DIRECT_CONN*1000*2);
nls.hReadConns[0] = pmmpd->hConnection;
bContinue = TRUE;
@@ -137,7 +136,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnect MraSendPacket(nls.hReadConns[0], 0, MRIM_CS_PROXY_HELLO, &pmmpd->mguidSessionID, sizeof(MRA_GUID));
while (bContinue) {
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ switch (Netlib_Select(&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwRetErrorCode = GetLastError();
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index acd9977a65..8ee2d7101f 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -148,12 +148,11 @@ DWORD CMraProto::MraGetNLBData(CMStringA &szHost, WORD *pwPort) while (--dwCurConnectReTryCount && nls.hReadConns[0] == NULL);
if (nls.hReadConns[0]) {
- nls.cbSize = sizeof(nls);
nls.dwTimeout = 1000 * getDword("TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB);
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ switch (Netlib_Select(&nls)) {
case SOCKET_ERROR:
case 0:// Time out
bContinue = FALSE;
@@ -218,8 +217,8 @@ DWORD CMraProto::MraNetworkDispatcher() dwCMDNum = 0;
MraSendCMD(MRIM_CS_HELLO, NULL, 0);
while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
- DWORD dwSelectRet = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
- if (SOCKET_ERROR == dwSelectRet) {
+ int iSelectRet = Netlib_Select(&nls);
+ if (SOCKET_ERROR == iSelectRet) {
if (m_iStatus != ID_STATUS_OFFLINE) {
dwRetErrorCode = GetLastError();
ShowFormattedErrorMessage(L"Disconnected, socket error", dwRetErrorCode);
@@ -267,7 +266,7 @@ DWORD CMraProto::MraNetworkDispatcher() }
}
- if (dwSelectRet == 0) // Time out
+ if (iSelectRet == 0) // Time out
continue;
// expand receive buffer dynamically
|