OSDN Git Service

Fix tail mass data problem at end of mail.
authorFrank Li <lznuaa@gmail.com>
Sat, 18 Apr 2009 14:01:55 +0000 (22:01 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 18 Apr 2009 14:01:55 +0000 (22:01 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Patch.cpp
src/TortoiseProc/SVNProgressDlg.cpp

index d479e41..bdf20e2 100644 (file)
@@ -132,7 +132,7 @@ int CPatch::Parser(CString &pathfile)
 {\r
        CString str;\r
 \r
-       CStdioFile PatchFile;\r
+       CFile PatchFile;\r
 \r
        m_PathFile=pathfile;\r
        if( ! PatchFile.Open(pathfile,CFile::modeRead) )\r
@@ -154,7 +154,8 @@ int CPatch::Parser(CString &pathfile)
 \r
        LONGLONG offset=PatchFile.GetPosition();\r
 #endif\r
-       PatchFile.Read(m_Body.GetBufferSetLength(PatchFile.GetLength()),PatchFile.GetLength());\r
+       PatchFile.Read(m_Body.GetBuffer(PatchFile.GetLength()),PatchFile.GetLength());\r
+       m_Body.ReleaseBuffer();\r
        PatchFile.Close();\r
 \r
        int start=0;\r
index 9a9e105..08b16bc 100644 (file)
@@ -2722,14 +2722,28 @@ bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation*
                CTGitPath path;\r
                Notify(path,git_wc_notify_sendmail_start);\r
                CString err;\r
-               if(CPatch::Send(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,this->m_SendMailFlags&SENDMAIL_ATTACHMENT,&err))\r
+               int retry=0;\r
+               while(retry <3)\r
                {\r
-                       Notify(path,git_wc_notify_sendmail_error,ret,&err);\r
-                       ret = false;\r
-               }else\r
-               {\r
-                       Notify(path,git_wc_notify_sendmail_done,ret);\r
+                       if(CPatch::Send(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,this->m_SendMailFlags&SENDMAIL_ATTACHMENT,&err))\r
+                       {\r
+                               Notify(path,git_wc_notify_sendmail_error,ret,&err);\r
+                               ret = false;\r
+                       }\r
+                       else\r
+                       {\r
+                               break;          \r
+                       }\r
+\r
+                       retry++;\r
+                       Sleep(2000);\r
+                       if(m_bCancelled)\r
+                       {\r
+                               Notify(path,git_wc_notify_sendmail_retry,ret,&CString("User Canceled"));\r
+                           return false;\r
+                       }\r
                }\r
+               Notify(path,git_wc_notify_sendmail_done,ret);\r
 \r
        }else\r
        {\r
@@ -2747,9 +2761,11 @@ bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation*
                                {\r
                                        Notify(m_targetPathList[i],git_wc_notify_sendmail_error,ret,&patch.m_LastError);\r
                                        ret = false;\r
+\r
                                }else\r
+                               {\r
                                        break;\r
-\r
+                               }\r
                                Notify(m_targetPathList[i],git_wc_notify_sendmail_retry,ret,&patch.m_LastError);\r
 \r
                                retry++;\r