From 363b48e60e54a68ff6ea69a5c71b5db6ace5416c Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sat, 18 Apr 2009 22:01:55 +0800 Subject: [PATCH] Fix tail mass data problem at end of mail. Signed-off-by: Frank Li --- src/TortoiseProc/Patch.cpp | 5 +++-- src/TortoiseProc/SVNProgressDlg.cpp | 30 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/TortoiseProc/Patch.cpp b/src/TortoiseProc/Patch.cpp index d479e41c3..bdf20e23b 100644 --- a/src/TortoiseProc/Patch.cpp +++ b/src/TortoiseProc/Patch.cpp @@ -132,7 +132,7 @@ int CPatch::Parser(CString &pathfile) { CString str; - CStdioFile PatchFile; + CFile PatchFile; m_PathFile=pathfile; if( ! PatchFile.Open(pathfile,CFile::modeRead) ) @@ -154,7 +154,8 @@ int CPatch::Parser(CString &pathfile) LONGLONG offset=PatchFile.GetPosition(); #endif - PatchFile.Read(m_Body.GetBufferSetLength(PatchFile.GetLength()),PatchFile.GetLength()); + PatchFile.Read(m_Body.GetBuffer(PatchFile.GetLength()),PatchFile.GetLength()); + m_Body.ReleaseBuffer(); PatchFile.Close(); int start=0; diff --git a/src/TortoiseProc/SVNProgressDlg.cpp b/src/TortoiseProc/SVNProgressDlg.cpp index 9a9e105ef..08b16bca2 100644 --- a/src/TortoiseProc/SVNProgressDlg.cpp +++ b/src/TortoiseProc/SVNProgressDlg.cpp @@ -2722,14 +2722,28 @@ bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation* CTGitPath path; Notify(path,git_wc_notify_sendmail_start); CString err; - if(CPatch::Send(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,this->m_SendMailFlags&SENDMAIL_ATTACHMENT,&err)) + int retry=0; + while(retry <3) { - Notify(path,git_wc_notify_sendmail_error,ret,&err); - ret = false; - }else - { - Notify(path,git_wc_notify_sendmail_done,ret); + if(CPatch::Send(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,this->m_SendMailFlags&SENDMAIL_ATTACHMENT,&err)) + { + Notify(path,git_wc_notify_sendmail_error,ret,&err); + ret = false; + } + else + { + break; + } + + retry++; + Sleep(2000); + if(m_bCancelled) + { + Notify(path,git_wc_notify_sendmail_retry,ret,&CString("User Canceled")); + return false; + } } + Notify(path,git_wc_notify_sendmail_done,ret); }else { @@ -2747,9 +2761,11 @@ bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation* { Notify(m_targetPathList[i],git_wc_notify_sendmail_error,ret,&patch.m_LastError); ret = false; + }else + { break; - + } Notify(m_targetPathList[i],git_wc_notify_sendmail_retry,ret,&patch.m_LastError); retry++; -- 2.11.4.GIT