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