summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-14 01:22:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-14 01:22:55 +0300
commitd3cb19278d60ac6f7963379254546cdca36a90e2 (patch)
treef2fa018b343d5460419c1b323f5f3ce04a393d00 /protocols/MRA/src
parentd5a6c0666a8d8d2055a3f4402f67f91e8548ec3a (diff)
separate handle types for HNETLIBCONN & HNETLIBBIND
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraAvatars.cpp12
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp7
-rw-r--r--protocols/MRA/src/MraFilesQueue.h2
-rw-r--r--protocols/MRA/src/MraMRIMProxy.cpp4
-rw-r--r--protocols/MRA/src/MraProto.h8
-rw-r--r--protocols/MRA/src/MraSendCommand.cpp2
6 files changed, 17 insertions, 18 deletions
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index 20d7cb9770..de646f2c2a 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -37,14 +37,14 @@ struct MRA_AVATARS_QUEUE_ITEM : public FIFO_MT_ITEM
char szAvtSectName[MAX_PATH];
#define MRA_AVT_SECT_NAME szAvtSectName
-HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort);
+HNETLIBCONN MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort);
#define MAHTRO_AVT 0
#define MAHTRO_AVTMRIM 1
#define MAHTRO_AVTSMALL 2
#define MAHTRO_AVTSMALLMRIM 3
-DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR lpszUser, LPCSTR lpszDomain, LPCSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime);
+DWORD MraAvatarsHttpTransaction(HNETLIBCONN hConnection, DWORD dwRequestType, LPCSTR lpszUser, LPCSTR lpszDomain, LPCSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime);
DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
{
@@ -152,7 +152,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
size_t dwAvatarSizeServer;
FILETIME ftLastModifiedTimeServer, ftLastModifiedTimeLocal;
SYSTEMTIME stAvatarLastModifiedTimeLocal;
- HANDLE hConnection = NULL;
+ HNETLIBCONN hConnection = NULL;
NETLIBSELECT nls = { 0 };
INTERNET_TIME itAvatarLastModifiedTimeServer;
WCHAR szErrorText[2048];
@@ -331,7 +331,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
CloseHandle(hThreadEvent);
}
-HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort)
+HNETLIBCONN MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwPort)
{
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
@@ -344,7 +344,7 @@ HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwP
DWORD dwConnectReTryCount = db_get_dw(NULL, MRA_AVT_SECT_NAME, "ConnectReTryCount", MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
DWORD dwCurConnectReTryCount = dwConnectReTryCount;
- HANDLE hConnection;
+ HNETLIBCONN hConnection;
do {
hConnection = Netlib_OpenConnection(hNetlibUser, &nloc);
}
@@ -353,7 +353,7 @@ HANDLE MraAvatarsHttpConnect(HNETLIBUSER hNetlibUser, LPCSTR lpszHost, DWORD dwP
return hConnection;
}
-DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR lpszUser, LPCSTR lpszDomain, LPCSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime)
+DWORD MraAvatarsHttpTransaction(HNETLIBCONN hConnection, DWORD dwRequestType, LPCSTR lpszUser, LPCSTR lpszDomain, LPCSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime)
{
if (pdwResultCode) *pdwResultCode = 0;
if (pbKeepAlive) *pbKeepAlive = FALSE;
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index 9b062e46c7..edf341a755 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -37,7 +37,7 @@ struct MRA_FILES_QUEUE_ITEM : public LIST_MT_ITEM
LPWSTR lpwszPath;
size_t dwPathSize;
bool bSending;
- HANDLE hConnection;
+ HNETLIBCONN hConnection;
HANDLE hListen;
HANDLE hThread;
HANDLE hWaitHandle;
@@ -378,7 +378,7 @@ DWORD CMraProto::MraFilesQueueSendMirror(HANDLE hQueue, DWORD dwIDRequest, const
return dwRetErrorCode;
}
-bool CMraProto::MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM *dat)
+bool CMraProto::MraFilesQueueHandCheck(HNETLIBCONN hConnection, MRA_FILES_QUEUE_ITEM *dat)
{
if (hConnection && dat) {
BYTE btBuff[((MAX_EMAIL_LEN * 2) + (sizeof(MRA_FT_HELLO)* 2) + 8)] = { 0 };
@@ -522,7 +522,6 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat)
// копируем адреса в соответствии с правилами и начинаем слушать порт
if (getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN)) {
NETLIBBIND nlbBind = {};
- nlbBind.cbSize = sizeof(nlbBind);
nlbBind.pfnNewConnectionV2 = MraFilesQueueConnectionReceived;
nlbBind.wPort = 0;
nlbBind.pExtra = (LPVOID)dat;
@@ -587,7 +586,7 @@ HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat)
// This function is called from the Netlib when someone is connecting to
// one of our incomming DC ports
-void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pExtra)
+void MraFilesQueueConnectionReceived(HNETLIBCONN hNewConnection, DWORD dwRemoteIP, void *pExtra)
{
if (pExtra) {
MRA_FILES_QUEUE_ITEM *dat = (MRA_FILES_QUEUE_ITEM*)pExtra;
diff --git a/protocols/MRA/src/MraFilesQueue.h b/protocols/MRA/src/MraFilesQueue.h
index dbcba782cf..c833c02fa5 100644
--- a/protocols/MRA/src/MraFilesQueue.h
+++ b/protocols/MRA/src/MraFilesQueue.h
@@ -8,7 +8,7 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam,
DWORD MraFilesQueueInitialize(DWORD dwFilesTimeOutInterval, HANDLE *phFilesQueueHandle);
void MraFilesQueueDestroy(HANDLE hFilesQueueHandle);
-void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pExtra);
+void MraFilesQueueConnectionReceived(HNETLIBCONN hNewConnection, DWORD dwRemoteIP, void *pExtra);
HANDLE MraFilesQueueItemProxyByID(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
diff --git a/protocols/MRA/src/MraMRIMProxy.cpp b/protocols/MRA/src/MraMRIMProxy.cpp
index f29fd6e0e8..1f9aa28733 100644
--- a/protocols/MRA/src/MraMRIMProxy.cpp
+++ b/protocols/MRA/src/MraMRIMProxy.cpp
@@ -11,7 +11,7 @@ struct MRA_MRIMPROXY_DATA
size_t dwUserDataSize;
MRA_ADDR_LIST malAddrList; // LPS lps_ip_port
MRA_GUID mguidSessionID; // DWORD session_id[4]
- HANDLE hConnection;
+ HNETLIBCONN hConnection;
HANDLE hWaitHandle; // internal
};
@@ -69,7 +69,7 @@ void MraMrimProxyCloseConnection(HANDLE hMraMrimProxyData)
}
}
-DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection)
+DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phConnection)
{
DWORD dwRetErrorCode;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index e9167e1879..89b969790b 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -166,7 +166,7 @@ struct CMraProto : public PROTO<CMraProto>
HANDLE hSendQueueHandle, hFilesQueueHandle, hMPopSessionQueue;
HANDLE m_heNudgeReceived;
- HANDLE m_hConnection;
+ HNETLIBCONN m_hConnection;
DWORD m_dwNextPingSendTickTime;
DWORD m_dwPingPeriod;
volatile DWORD m_dwThreadWorkerLastPingTime;
@@ -215,7 +215,7 @@ struct CMraProto : public PROTO<CMraProto>
DWORD MraProxyAck(DWORD dwStatus, const CMStringA &szEmail, DWORD dwIDRequest, DWORD dwDataType, const CMStringA &lpszData, const CMStringA &szAddresses, MRA_GUID mguidSessionID);
DWORD MraChangeUserBlogStatus(DWORD dwFlags, const CMStringW &wszText, DWORDLONG dwBlogStatusID);
- DWORD MraSendPacket(HANDLE hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize);
+ DWORD MraSendPacket(HNETLIBCONN hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize);
DWORD MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize);
DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, MCONTACT hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize);
@@ -289,7 +289,7 @@ struct CMraProto : public PROTO<CMraProto>
bool MraSendReplyBlogStatus(MCONTACT hContact);
DWORD MraSelectEMailDlgShow(MCONTACT hContact, DWORD dwType);
- DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection);
+ DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HNETLIBCONN *phConnection);
DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, const CMStringA &szUrl);
DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue, const CMStringA &, CMStringA &szEmail);
@@ -302,7 +302,7 @@ struct CMraProto : public PROTO<CMraProto>
DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline);
DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, const CMStringA &szAddresses);
- bool MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+ bool MraFilesQueueHandCheck(HNETLIBCONN hConnection, MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPCWSTR lpwszPath, size_t dwPathSize);
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp
index f5c9849e9f..7fdbfb361f 100644
--- a/protocols/MRA/src/MraSendCommand.cpp
+++ b/protocols/MRA/src/MraSendCommand.cpp
@@ -498,7 +498,7 @@ DWORD CMraProto::MraChangeUserBlogStatus(DWORD dwFlags, const CMStringW &wszText
return MraSendCMD(MRIM_CS_CHANGE_USER_BLOG_STATUS, buf.Data(), buf.Len());
}
-DWORD CMraProto::MraSendPacket(HANDLE hConnection, DWORD dwCmdNum, DWORD dwType, LPVOID lpData, size_t dwDataSize)
+DWORD CMraProto::MraSendPacket(HNETLIBCONN hConnection, DWORD dwCmdNum, DWORD dwType, LPVOID lpData, size_t dwDataSize)
{
LPBYTE lpbData = (LPBYTE)_alloca(dwDataSize + sizeof(mrim_packet_header_t));