summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/filetransfer.cpp
diff options
context:
space:
mode:
authorSzymon Tokarz <wsx22@o2.pl>2012-12-31 13:22:28 +0000
committerSzymon Tokarz <wsx22@o2.pl>2012-12-31 13:22:28 +0000
commitfd19769f410fe114451ea1329f676ed28c555b2f (patch)
tree5b521f080dcb3b7e785c9c14edce80249dfc51d0 /protocols/Gadu-Gadu/src/filetransfer.cpp
parent6410348ada83ca5fea19f706506ae4afaf8f4a89 (diff)
Gadu-Gadu protocol:
- show error popup when file io function returns an error code hope to explain avatar problems git-svn-id: http://svn.miranda-ng.org/main/trunk@2895 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/filetransfer.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index a111bbb022..f5436008a9 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -680,7 +680,10 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath)
// Open file for appending and check if ok
if ((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
- netlog("dccfileallow(): Failed to create file \"%s\".", fileName);
+ netlog("dccfileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
+ TCHAR error[512];
+ mir_sntprintf(error, SIZEOF(error), TranslateT("Can not create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
+ showpopup(m_tszUserName, error, GG_POPUP_ERROR);
ProtoBroadcastAck(m_szModuleName, dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Free transfer
gg_free_dcc(dcc);
@@ -728,7 +731,10 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath)
// Open file for appending and check if ok
if ((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
- netlog("dcc7fileallow(): Failed to create file \"%s\".", fileName);
+ netlog("dcc7fileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
+ TCHAR error[512];
+ mir_sntprintf(error, SIZEOF(error), TranslateT("Can not create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
+ showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
ProtoBroadcastAck(m_szModuleName, dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free transfer