fix handling of null terminator byte on long mapi messages, more pr logging for mapi send, sr=mscott 108275

This commit is contained in:
bienvenu%nventure.com 2004-05-03 16:24:56 +00:00
Родитель 304a7fcba3
Коммит 8357ccfa08
2 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -41,6 +41,10 @@
#define MAPI_STARTUP_ARG "/MAPIStartUp"
#ifdef MOZ_LOGGING
// this has to be before the pre-compiled header
#define FORCE_PR_LOG /* Allow logging in the release build */
#endif
#include <mapidefs.h>
#include <mapi.h>
#include <tchar.h>
@ -83,6 +87,9 @@
#include "msgMapiMain.h"
#include "nsNetUtil.h"
extern PRLogModuleInfo *MAPI;
static NS_DEFINE_CID(kCmdLineServiceCID, NS_COMMANDLINE_SERVICE_CID);
class nsMAPISendListener : public nsIMsgSendListener
@ -469,6 +476,7 @@ nsresult nsMapiHook::PopulateCompFields(lpnsMapiMessage aMessage,
}
}
PR_LOG(MAPI, PR_LOG_DEBUG, ("to: %s cc: %s bcc: %s \n", NS_ConvertUCS2toUTF8(To).get(), NS_ConvertUCS2toUTF8(Cc).get(), NS_ConvertUCS2toUTF8(Bcc).get()));
// set To, Cc, Bcc
aCompFields->SetTo (To) ;
aCompFields->SetCc (Cc) ;
@ -704,6 +712,8 @@ nsresult nsMapiHook::PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
aCompFields->SetCc (Cc) ;
aCompFields->SetBcc (Bcc) ;
PR_LOG(MAPI, PR_LOG_DEBUG, ("to: %s cc: %s bcc: %s \n", NS_ConvertUCS2toUTF8(To).get(), NS_ConvertUCS2toUTF8(Cc).get(), NS_ConvertUCS2toUTF8(Bcc).get()));
nsCAutoString platformCharSet;
// set subject
if (aMessage->lpszSubject)

Просмотреть файл

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_LOGGING
// sorry, this has to be before the pre-compiled header
// this has to be before the pre-compiled header
#define FORCE_PR_LOG /* Allow logging in the release build */
#endif
#include <mapidefs.h>
@ -241,6 +241,9 @@ STDMETHODIMP CMapiImp::SendMail( unsigned long aSession, lpnsMapiMessage aMessag
aMessage->lpRecips = aRecips ;
aMessage->lpFiles = aFiles ;
PR_LOG(MAPI, PR_LOG_DEBUG, ("CMapiImp::SendMail flags=%x subject: %s sender: %s\n",
aFlags, (char *) aMessage->lpszSubject, aMessage->lpOriginator->lpszAddress) );
/** create nsIMsgCompFields obj and populate it **/
nsCOMPtr<nsIMsgCompFields> pCompFields = do_CreateInstance(NS_MSGCOMPFIELDS_CONTRACTID, &rv) ;
if (NS_FAILED(rv) || (!pCompFields) ) return MAPI_E_INSUFFICIENT_MEMORY ;
@ -799,8 +802,10 @@ char *MsgMapiListContext::ConvertBodyToMapiFormat (nsIMsgDBHdr *hdr)
curLine.Append(CRLF);
// make sure we have room left
if (bytesCopied + curLine.Length() < msgSize)
{
strcpy(body + bytesCopied, curLine.get());
bytesCopied += curLine.Length();
bytesCopied += curLine.Length();
}
}
PR_LOG(MAPI, PR_LOG_DEBUG, ("ConvertBodyToMapiFormat size=%x allocated size %x body = %100.100s\n",
bytesCopied, msgSize + 1, (char *) body) );