maildev@lists.thunderbird.net

Thunderbird email developers

View all threads

m_inputStream, anyone?

JK
Jörg Knobloch
Wed, Oct 4, 2017 9:07 PM

Hi all,

does anyone know whether inputStream defined in mailnews/base/util/nsMsgProtocol.h and used in nsMsgProtocol.cpp, nsMailboxProtocol.cpp and nsImapProtocol.cpp must be the same storage or whether those three files can have their own storage as I've just suggested in the patch attached to that bug.

The background is that the "sliced stuff" us getting worse, now the sliced stream is taking ownership of the original stream and if that's a member variable used elsewhere it needs to be cloned (cloNed, not closed).

The whole thing has become terribly complicated, by losing parameters from two Necko functions for offset and length we now need to use that sliced stream, and since M-C found bugs in it (like closing wasn't passed on to the original stream), the CTOR now takes ownership forcing us to clone streams on top of that. Also, M-C will land their piece soon, which will leave us busted or at least broken.

I think forking 350 lines looks increasingly attractive compared to the "proper" way of having an intermediate stream and a cloned one on top of that.

Decoupling m_inputStream would at least kill one clone.

Jörg.

-------- Forwarded Message --------    Subject:  [Bug 1403771] Compaction on Windows broken, caused by bug 1403393 / bug 1402888 - Fix test_folderCompact.js, test_over4GBMailboxes.js, see comment #13 (failing test_gloda_content_imap_offline.js, test_compactOfflineStore.js fixed in bug 1404045)  Date:  Wed, 04 Oct 2017 20:52:16 +0000  From:  Bugzilla@Mozilla <bugzilla-daemon@mozilla.org>  To:  jorgk@jorgk.com

https://bugzilla.mozilla.org/show_bug.cgi?id=1403771

--- Comment #48 from Jorg K (GMT+2) <jorgk@jorgk.com> 2017-10-04 22:52:16 CEST ---
Created attachment 8915324
--> https://bugzilla.mozilla.org/attachment.cgi?id=8915324&action=edit
1403771-sliced-ownership2.patch

Here's a sightly more adventurous patch decoupling the use if m_inputStream in
various source files to avoid stream cloning once.

mozilla/mach xpcshell-test mailnews/base/test/unit/test_folderCompact.js
still fails, I guess the problem is with m_multipleMsgMoveCopyStream which is
still cloned and then maybe not closed properly.

<pre class="moz-signature">-- 
Configure bugmail: <a class="moz-txt-link-freetext" href="https://bugzilla.mozilla.org/userprefs.cgi?tab=email">https://bugzilla.mozilla.org/userprefs.cgi?tab=email</a>

-------------------------------
Product/Component: MailNews Core :: Database



------- You are receiving this mail because: -------
You reported the bug.


JK
Jörg Knobloch
Wed, Oct 4, 2017 9:32 PM

On 04/10/2017 23:07, Jörg Knobloch wrote:

does anyone know whether inputStream defined in
mailnews/base/util/nsMsgProtocol.h and ...

Oops, make that m_inputStream, sorry.

On 04/10/2017 23:07, Jörg Knobloch wrote: > does anyone know whether inputStream defined in > mailnews/base/util/nsMsgProtocol.h and ... Oops, make that m_inputStream, sorry.