{\r
CString str;\r
\r
- CStdioFile PatchFile;\r
+ CFile PatchFile;\r
\r
m_PathFile=pathfile;\r
if( ! PatchFile.Open(pathfile,CFile::modeRead) )\r
\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
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
{\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