Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.
authorAustin Clements <amdragon@MIT.EDU>
Sun, 4 Dec 2011 19:26:36 +0000 (14:26 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:34 +0000 (09:40 -0800)
90/dbe8b961d3635cbc62aa5690cf2967c6395c76 [new file with mode: 0644]

diff --git a/90/dbe8b961d3635cbc62aa5690cf2967c6395c76 b/90/dbe8b961d3635cbc62aa5690cf2967c6395c76
new file mode 100644 (file)
index 0000000..bbdce2a
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id B5B97429E25\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:24:55 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id vOiWpk6eLIQL for <notmuch@notmuchmail.org>;\r
+       Sun,  4 Dec 2011 11:24:55 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
+       [18.7.68.35])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2A8F5429E21\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:24:55 -0800 (PST)\r
+X-AuditID: 12074423-b7f266d0000008b8-13-4edbc904ca2d\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 1E.5F.02232.409CBDE4; Sun,  4 Dec 2011 14:24:52 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pB4JOpgL022770; \r
+       Sun, 4 Dec 2011 14:24:51 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pB4JOo5L028783\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 4 Dec 2011 14:24:50 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RXHhs-00066v-CA; Sun, 04 Dec 2011 14:26:36 -0500\r
+Date: Sun, 4 Dec 2011 14:26:36 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME\r
+       traversal.\r
+Message-ID: <20111204192635.GV16194@mit.edu>\r
+References: <1322446871-14986-1-git-send-email-amdragon@mit.edu>\r
+       <1322446871-14986-3-git-send-email-amdragon@mit.edu>\r
+       <8739d6u4ju.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <8739d6u4ju.fsf@nikula.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixG6nrsty8rafweQF7Bat3Z+ZLJqmO1tc\r
+       vzmT2YHZ42x3O6vHrfuv2T2erbrFHMAcxWWTkpqTWZZapG+XwJVxZftWxoJF7BVX7lY2MD5n\r
+       7WLk5JAQMJE4cWwlC4QtJnHh3nq2LkYuDiGBfYwSWyZ+Y4Rw1jNKvLi0gxnCOcEksWTSN1YI\r
+       ZwmjxJG3c5lB+lkEVCTefn/HDmKzCWhIbNu/nBHEFhFQlNh8cj+QzcHBLGAkseq7HogpLBAh\r
+       8XRHHUgFr4COxJqXM6FGTmWUmPBtIjNEQlDi5MwnYOcxC2hJ3Pj3kglijLTE8n8cIGFOoE3P\r
+       PreCbRIFumDKyW1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6Znq5\r
+       mSV6qSmlmxjBYe6ivIPxz0GlQ4wCHIxKPLyZJ275CbEmlhVX5h5ilORgUhLlZT1x20+ILyk/\r
+       pTIjsTgjvqg0J7X4EKMEB7OSCG/GYqAcb0piZVVqUT5MSpqDRUmcV2ang5+QQHpiSWp2ampB\r
+       ahFMVoaDQ0mCtxZkqGBRanpqRVpmTglCmomDE2Q4D9DwXSA1vMUFibnFmekQ+VOMuhwn7/af\r
+       YRRiycvPS5US550MUiQAUpRRmgc3B5aeXjGKA70lzFsJUsUDTG1wk14BLWECWqLYeANkSUki\r
+       QkqqgTFIIc5l5eQ7nAGNzf7lh46UC9cd/Gwbtun5BHbPDwml7NzLdIN/Lo5zKeb4ZR93bctf\r
+       p5PcB3Nvu571vvm29fRr/znbPSq81PvnM2qvORXQV7HG2tB9w86dWh1z89ak3bon5+jVuj/r\r
+       c4DB/QuptYxvUuyazGTnPbnueozxXkPAxf1H9odNOaHEUpyRaKjFXFScCABw4uZAKgMAAA==\r
+Cc: notmuch@notmuchmail.org, dkg@fifthhorseman.net\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 04 Dec 2011 19:24:55 -0000\r
+\r
+Thanks for the review.  A new version is on its way...\r
+\r
+Quoth Jani Nikula on Nov 29 at  9:11 pm:\r
+> > +    mctx->stream = g_mime_stream_file_new (mctx->file);\r
+> \r
+> AFAICT the GMimeStreamFile object owns the FILE * pointer now, and\r
+> closes it later. Calling fclose() on it in _mime_node_context_free()\r
+> would be undefined behaviour. But please don't just take my word for it.\r
+\r
+The next line tells GMime not to close the stream on its own.\r
+\r
+Though, while I believe the code is correct, I'm not sure why we can't\r
+just let GMime close the stream and remove our fclose.  The original\r
+code for this was introduced in 357aba3e (along with most of the code\r
+in show-message.c) with the cryptic comment that otherwise GMime would\r
+close stdout.  Since I'd rather not regress some bug I don't\r
+understand, I'll leave the code the way it is.\r
+\r
+> > +    g_mime_stream_file_set_owner (GMIME_STREAM_FILE (mctx->stream), FALSE);\r