diff --git a/mailnews/mime/public/nsIMimeHeaders.idl b/mailnews/mime/public/nsIMimeHeaders.idl index dd1b4387e60..cc20e38991a 100644 --- a/mailnews/mime/public/nsIMimeHeaders.idl +++ b/mailnews/mime/public/nsIMimeHeaders.idl @@ -36,10 +36,10 @@ [scriptable, uuid(13E16676-6648-11d3-A72F-0060B0EB39B5)] interface nsIMimeHeaders : nsISupports { - void initialize([const] in string allHeaders); + void initialize([const] in string allHeaders, in long allHeadersSize); string extractHeader ([const] in string headerName, in boolean getAllOfThem); }; %{C++ nsresult NS_NewMimeHeaders(const nsIID &aIID, void ** aInstancePtrResult); -%} \ No newline at end of file +%} diff --git a/mailnews/mime/src/nsMimeHeaders.cpp b/mailnews/mime/src/nsMimeHeaders.cpp index 7fbbb83c342..0b704912586 100644 --- a/mailnews/mime/src/nsMimeHeaders.cpp +++ b/mailnews/mime/src/nsMimeHeaders.cpp @@ -39,7 +39,7 @@ nsMimeHeaders::~nsMimeHeaders() NS_IMPL_ISUPPORTS(nsMimeHeaders, NS_GET_IID(nsIMimeHeaders)) -nsresult nsMimeHeaders::Initialize(const char * aAllHeaders) +nsresult nsMimeHeaders::Initialize(const char * aAllHeaders, PRInt32 allHeadersSize) { /* just in case we want to reuse the object, cleanup...*/ if (mHeaders) @@ -47,7 +47,7 @@ nsresult nsMimeHeaders::Initialize(const char * aAllHeaders) mHeaders = MimeHeaders_new(); if (mHeaders) - return MimeHeaders_parse_line(aAllHeaders, nsCRT::strlen(aAllHeaders), mHeaders); + return MimeHeaders_parse_line(aAllHeaders, allHeadersSize, mHeaders); return NS_ERROR_OUT_OF_MEMORY; } @@ -60,3 +60,4 @@ nsresult nsMimeHeaders::ExtractHeader(const char *headerName, PRBool getAllOfThe *_retval = MimeHeaders_get(mHeaders, headerName, PR_FALSE, getAllOfThem); return NS_OK; } + diff --git a/mailnews/mime/src/nsStreamConverter.cpp b/mailnews/mime/src/nsStreamConverter.cpp index 8f53344a063..e7c1ad647ac 100644 --- a/mailnews/mime/src/nsStreamConverter.cpp +++ b/mailnews/mime/src/nsStreamConverter.cpp @@ -939,7 +939,7 @@ nsStreamConverter::OnStopRequest(nsIChannel * aChannel, nsISupports *ctxt, nsres if (NS_SUCCEEDED(rv)) { if (*workHeaders) - mimeHeaders->Initialize((*workHeaders)->all_headers); + mimeHeaders->Initialize((*workHeaders)->all_headers, (*workHeaders)->all_headers_fp); mMimeStreamConverterListener->OnHeadersReady(mimeHeaders); } else