CrashRpt 1403 queued reports sending bug fix

102 views
Skip to first unread message

rezzu

unread,
May 29, 2015, 3:02:54 AM5/29/15
to cras...@googlegroups.com
Hi,

I had a problem with CrashRpt in my project and I fixed it. The problem was that when trying to send queued crash reports (chosen to be sent later by "Close the program and send report later") via SMTP only the first report was sent and all after that failed.

By reading the batch log file and the source code and by debugging I deduced that CrashSender tried to send all the previous crash reports too when sending n-th report. So I just added the following lines:

ErrorReportsender.cpp line 2077:
 // Remove the ZIP and MD5 files from the attachment list
 m_EmailMsg
.RemoveAttachment(0);
 m_EmailMsg
.RemoveAttachment(0);


 
// Remove the recipient so that there will be no copies
 m_EmailMsg
.RemoveRecipient(0);

smtpclient.h, class CEmailMessage public interface:
 // Removes n-th attachment.
 
void RemoveAttachment(int nAttachment);

 
// Adds a recipient address.
 
void RemoveRecipient(int nRecipient);

smtpclient.cpp:
void CEmailMessage::RemoveRecipient(int nRecipient) {
 
// Removes n-th recipient address
 
if (nRecipient >= (int)m_aTo.size() || nRecipient < 0) {
   
throw std::out_of_range("nRecipient out of range");
 
}
 m_aTo
.erase(m_aTo.begin() + nRecipient);
}

void CEmailMessage::RemoveAttachment(int nAttachment) {
 
// Removes n-th attachment.
 
if (nAttachment >= (int)m_aAttachments.size() || nAttachment < 0) {
   
throw std::out_of_range("nAttachment out of range");
 
}
 m_aAttachments
.erase(m_aAttachments.begin() + nAttachment);
}


Could this fix be implemented as soon as possible?
Reply all
Reply to author
Forward
0 new messages