diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-13 00:01:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-13 00:01:59 +0300 |
commit | e145db68fb5b7d0682a4b2be0174cebfe47dd74e (patch) | |
tree | c8f9edc907876d236eb16bc8ca8b592accb9846f /protocols/MRA/src | |
parent | 3cb3883908e3168e5f955be3143771721614307a (diff) |
a bit less netlib services
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 10 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 7 | ||||
-rw-r--r-- | protocols/MRA/src/MraMRIMProxy.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 6 | ||||
-rw-r--r-- | protocols/MRA/src/stdafx.h | 2 |
6 files changed, 15 insertions, 16 deletions
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index a14c976c64..2979323977 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -18,7 +18,7 @@ const LPSTR lpcszContentType[9] = struct MRA_AVATARS_QUEUE : public FIFO_MT
{
- HANDLE hNetlibUser;
+ HNETLIBUSER hNetlibUser;
HANDLE hThreadEvents[64];
int iThreadsCount, iThreadsRunning;
};
@@ -37,7 +37,7 @@ struct MRA_AVATARS_QUEUE_ITEM : public FIFO_MT_ITEM char szAvtSectName[MAX_PATH];
#define MRA_AVT_SECT_NAME szAvtSectName
-HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPCSTR lpszHost, DWORD dwPort);
+HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort);
#define MAHTRO_AVT 0
#define MAHTRO_AVTMRIM 1
@@ -333,7 +333,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) CloseHandle(hThreadEvent);
}
-HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPCSTR lpszHost, DWORD dwPort)
+HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort)
{
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
@@ -348,7 +348,7 @@ HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPCSTR lpszHost, DWORD dwPort) DWORD dwCurConnectReTryCount = dwConnectReTryCount;
HANDLE hConnection;
do {
- hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
+ hConnection = Netlib_OpenConnection(hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && hConnection == NULL);
@@ -393,7 +393,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
nlhr.headersCount = 4;
- DWORD dwSent = CallService(MS_NETLIB_SENDHTTPREQUEST, (WPARAM)hConnection, (LPARAM)&nlhr);
+ DWORD dwSent = Netlib_SendHttpRequest(hConnection, &nlhr);
if (dwSent == SOCKET_ERROR || !dwSent)
return GetLastError();
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index 83234d5adf..bad116e95e 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -471,7 +471,7 @@ HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat) dwCurConnectReTryCount = dwConnectReTryCount;
do {
- dat->hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
+ dat->hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && dat->hConnection == NULL);
@@ -521,14 +521,13 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat) // копируем адреса в соответствии с правилами и начинаем слушать порт
if (getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) {
- NETLIBBIND nlbBind = { 0 };
-
+ NETLIBBIND nlbBind = {};
nlbBind.cbSize = sizeof(nlbBind);
nlbBind.pfnNewConnectionV2 = MraFilesQueueConnectionReceived;
nlbBind.wPort = 0;
nlbBind.pExtra = (LPVOID)dat;
- dat->hListen = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)m_hNetlibUser, (LPARAM)&nlbBind);
+ dat->hListen = Netlib_BindPort(m_hNetlibUser, &nlbBind);
if (dat->hListen) {
ProtoBroadcastAck(dat->hContact, ACKTYPE_FILE, ACKRESULT_LISTENING, (HANDLE)dat->dwIDRequest, 0);
dwAddrListSize = MraFilesQueueGetLocalAddressesList(szAddrList, sizeof(szAddrList), nlbBind.wPort);
diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp index e3789af1e2..2953356770 100644 --- a/protocols/MRA/src/MraMRIMProxy.cpp +++ b/protocols/MRA/src/MraMRIMProxy.cpp @@ -121,7 +121,7 @@ DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnect dwCurConnectReTryCount = dwConnectReTryCount;
do {
- pmmpd->hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
+ pmmpd->hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && pmmpd->hConnection == NULL);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index a63493bfc3..da0f03fd69 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -693,10 +693,10 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & }
}
-bool IsHTTPSProxyUsed(HANDLE hNetlibUser)
+bool IsHTTPSProxyUsed(HNETLIBUSER hNetlibUser)
{
NETLIBUSERSETTINGS nlus = { sizeof(nlus) };
- if (CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)hNetlibUser, (LPARAM)&nlus))
+ Netlib_GetUserSettings(hNetlibUser, &nlus);
if (nlus.useProxy && nlus.proxyType == PROXYTYPE_HTTPS)
return true;
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 2245fd2604..acd9977a65 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -59,7 +59,7 @@ void CMraProto::MraThreadProc(LPVOID) dwCurConnectReTryCount = dwConnectReTryCount;
do {
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
- m_hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
+ m_hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && m_hConnection == NULL);
@@ -82,7 +82,7 @@ void CMraProto::MraThreadProc(LPVOID) dwCurConnectReTryCount = dwConnectReTryCount;
do {
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
- m_hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
+ m_hConnection = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && m_hConnection == NULL);
@@ -143,7 +143,7 @@ DWORD CMraProto::MraGetNLBData(CMStringA &szHost, WORD *pwPort) dwCurConnectReTryCount = dwConnectReTryCount;
do {
InterlockedExchange((volatile LONG*)&m_dwThreadWorkerLastPingTime, GetTickCount());
- nls.hReadConns[0] = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
+ nls.hReadConns[0] = Netlib_OpenConnection(m_hNetlibUser, &nloc);
}
while (--dwCurConnectReTryCount && nls.hReadConns[0] == NULL);
diff --git a/protocols/MRA/src/stdafx.h b/protocols/MRA/src/stdafx.h index 6fd37937ae..29dfaa5fe9 100644 --- a/protocols/MRA/src/stdafx.h +++ b/protocols/MRA/src/stdafx.h @@ -199,7 +199,7 @@ CMStringA CopyNumber(const CMStringA&); CMStringW DecodeXML(const CMStringW &lptszMessage);
CMStringW EncodeXML(const CMStringW &lptszMessage);
-bool IsHTTPSProxyUsed(HANDLE hConnection);
+bool IsHTTPSProxyUsed(HNETLIBUSER hConnection);
bool IsContactMraProto(MCONTACT hContact);
bool IsEMailMR(const CMStringA& szEmail);
bool GetEMailFromString(const CMStringA& szBuff, CMStringA& szEmail);
|