diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-16 21:08:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-16 21:08:43 +0000 |
commit | 111745a87ba9ae1c3b750534f89afdd503f1aec8 (patch) | |
tree | c6d7859d46b425fdedea129ec6b24e12a41f466c /protocols/MRA/MraSendCommand.cpp | |
parent | 97e2699bcaf406eba0eada8fd48d26735458fafc (diff) |
some fixes for MRA file transfers
git-svn-id: http://svn.miranda-ng.org/main/trunk@1586 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/MraSendCommand.cpp')
-rw-r--r-- | protocols/MRA/MraSendCommand.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/protocols/MRA/MraSendCommand.cpp b/protocols/MRA/MraSendCommand.cpp index 2d56edb6b7..13bf18e557 100644 --- a/protocols/MRA/MraSendCommand.cpp +++ b/protocols/MRA/MraSendCommand.cpp @@ -89,7 +89,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, lpbDataCurrent = lpbAuthMsgBuff;
SetUL(&lpbDataCurrent, 2);
SetLPSW(&lpbDataCurrent, NULL, 0);//***deb possible nick here
- SetLPSW(&lpbDataCurrent, (LPWSTR)lpwszMessage, dwMessageSize);
+ SetLPSW(&lpbDataCurrent, lpwszMessage, dwMessageSize);
BASE64EncodeUnSafe(lpbAuthMsgBuff, (lpbDataCurrent-lpbAuthMsgBuff), lpszMessageConverted, dwMessageConvertedBuffSize, &dwMessageConvertedSize);
}
@@ -343,27 +343,27 @@ DWORD CMraProto::MraChangeStatusW(DWORD dwStatus, LPSTR lpszStatusUri, size_t dw }
// Отправка файлов
-DWORD CMraProto::MraFileTransfer(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwFilesTotalSize, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize)
+DWORD CMraProto::MraFileTransfer(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwFilesTotalSize, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddressesSize)
{
DWORD dwRet = 0;
if (lpszEMail && dwEMailSize>4) {
int dwFilesSizeA = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFiles, dwFilesSize, NULL, 0, NULL, NULL);
- LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+dwFilesSizeA+(dwFilesSize*sizeof(WCHAR))+dwAddresesSize+MAX_PATH));
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+dwFilesSizeA+(dwFilesSize*sizeof(WCHAR))+dwAddressesSize+MAX_PATH));
if (lpbData) {
LPBYTE lpbDataCurrent = lpbData;
SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
SetUL(&lpbDataCurrent, dwIDRequest);
SetUL(&lpbDataCurrent, dwFilesTotalSize);
- SetUL(&lpbDataCurrent, (sizeof(DWORD)+dwFilesSizeA + sizeof(DWORD)+(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))) + sizeof(DWORD)+(DWORD)dwAddresesSize));
+ SetUL(&lpbDataCurrent, sizeof(DWORD)*5 + dwFilesSizeA + dwFilesSize*sizeof(WCHAR) + DWORD(dwAddressesSize));
SetLPSWtoA(&lpbDataCurrent, lpwszFiles, dwFilesSize);
- SetUL(&lpbDataCurrent, (sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))));
+ SetUL(&lpbDataCurrent, sizeof(DWORD)*2 + dwFilesSize*sizeof(WCHAR));
SetUL(&lpbDataCurrent, 1);
SetLPSW(&lpbDataCurrent, lpwszFiles, dwFilesSize);
- SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddressesSize);
dwRet = MraSendCMD(MRIM_CS_FILE_TRANSFER, lpbData, lpbDataCurrent-lpbData);
mir_free(lpbData);
@@ -583,19 +583,19 @@ DWORD CMraProto::MraSMSW(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize, L }
// Соединение с прокси
-DWORD CMraProto::MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID)
+DWORD CMraProto::MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddressesSize, MRA_GUID mguidSessionID)
{
DWORD dwRet = 0;
if (lpszEMail && dwEMailSize>4) {
- LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*2)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*2)+dwDataSize+dwAddressesSize+sizeof(MRA_GUID)+32));
if (lpbData) {
LPBYTE lpbDataCurrent = lpbData;
SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
SetUL(&lpbDataCurrent, dwIDRequest);
SetUL(&lpbDataCurrent, dwDataType);
SetLPS(&lpbDataCurrent, lpszData, dwDataSize);
- SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddressesSize);
SetGUID(&lpbDataCurrent, mguidSessionID);
dwRet = MraSendCMD(MRIM_CS_PROXY, lpbData, (lpbDataCurrent-lpbData));
@@ -606,12 +606,12 @@ DWORD CMraProto::MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest }
// Ответ на соединение с прокси
-DWORD CMraProto::MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID)
+DWORD CMraProto::MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddressesSize, MRA_GUID mguidSessionID)
{
DWORD dwRet = 0;
if (lpszEMail && dwEMailSize>4) {
- LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*3)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*3)+dwDataSize+dwAddressesSize+sizeof(MRA_GUID)+32));
if (lpbData) {
LPBYTE lpbDataCurrent = lpbData;
SetUL(&lpbDataCurrent, dwStatus);
@@ -619,7 +619,7 @@ DWORD CMraProto::MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize SetUL(&lpbDataCurrent, dwIDRequest);
SetUL(&lpbDataCurrent, dwDataType);
SetLPS(&lpbDataCurrent, lpszData, dwDataSize);
- SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddressesSize);
SetGUID(&lpbDataCurrent, mguidSessionID);
dwRet = MraSendCMD(MRIM_CS_PROXY_ACK, lpbData, (lpbDataCurrent-lpbData));
|