summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_misc.cpp
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-05-27 01:13:45 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-05-27 01:13:45 +0000
commitc014bd45e4761fd8da881e4f726022fc918624b2 (patch)
treedd48c9cfe1614748b303b37035525e706e872a34 /protocols/MSN/src/msn_misc.cpp
parent7101bc5c14b738fb783dfd5a7f6f7d11762cbe2a (diff)
Implemented fetching Skype Token for Cloud storage API.
Fixed error handling. Implemented handling of RichText/UriObject git-svn-id: http://svn.miranda-ng.org/main/trunk@13855 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_misc.cpp')
-rw-r--r--protocols/MSN/src/msn_misc.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index f52e6a826e..a0657fec04 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -1112,7 +1112,6 @@ void CMsnProto::MSN_ShowPopup(const MCONTACT hContact, const TCHAR* msg, int fla
/////////////////////////////////////////////////////////////////////////////////////////
// filetransfer class members
-#ifdef OBSOLETE
filetransfer::filetransfer(CMsnProto* prt)
{
memset(this, 0, sizeof(filetransfer));
@@ -1122,6 +1121,7 @@ filetransfer::filetransfer(CMsnProto* prt)
proto = prt;
hLockHandle = CreateMutex(NULL, FALSE, NULL);
+ hResumeEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
}
filetransfer::~filetransfer(void)
@@ -1131,11 +1131,14 @@ filetransfer::~filetransfer(void)
WaitForSingleObject(hLockHandle, 2000);
CloseHandle(hLockHandle);
+ CloseHandle(hResumeEvt);
if (fileId != -1) {
_close(fileId);
- if (p2p_appID != MSN_APPID_FILE && !(std.flags & PFTS_SENDING))
+#ifdef OBSOLETE
+ if (tType != SERVER_HTTP && p2p_appID != MSN_APPID_FILE && !(std.flags & PFTS_SENDING))
proto->p2p_pictureTransferFailed(this);
+#endif
}
if (!bCompleted && p2p_appID == MSN_APPID_FILE) {
@@ -1176,7 +1179,10 @@ void filetransfer::complete(void)
int filetransfer::create(void)
{
- fileId = _topen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
+ int flags = _O_BINARY | _O_CREAT | _O_WRONLY | _O_APPEND;
+
+ if (std.currentFileProgress == 0) flags |= _O_TRUNC;
+ fileId = _topen(std.tszCurrentFile, flags, _S_IREAD | _S_IWRITE);
if (fileId == -1)
proto->MSN_ShowError("Cannot create file '%s' during a file transfer", std.tszCurrentFile);
@@ -1225,6 +1231,7 @@ int filetransfer::openNext(void)
return fileId;
}
+#ifdef OBSOLETE
directconnection::directconnection(const char* CallID, const char* Wlid)
{
memset(this, 0, sizeof(directconnection));
@@ -1287,8 +1294,6 @@ void directconnection::xNonceToBin(UUID* nonce)
p[len - 2] = 0;
UuidFromStringA((BYTE*)p, nonce);
}
-#else
-filetransfer::~filetransfer(void) { }
#endif
/////////////////////////////////////////////////////////////////////////////////////////