From: David Bremner Date: Fri, 15 Jul 2016 00:23:20 +0000 (+2100) Subject: Re: [PATCH v4 09/16] index encrypted parts when asked. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0cec17a3c6544cd608b692b8033b461cfb63b20d;p=notmuch-archives.git Re: [PATCH v4 09/16] index encrypted parts when asked. --- diff --git a/07/b85662fb95f3301db5a414e4d05c240e4626c2 b/07/b85662fb95f3301db5a414e4d05c240e4626c2 new file mode 100644 index 000000000..38dedf921 --- /dev/null +++ b/07/b85662fb95f3301db5a414e4d05c240e4626c2 @@ -0,0 +1,97 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 52B506DE00F5 + for ; Thu, 14 Jul 2016 17:23:36 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.011 +X-Spam-Level: +X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[AWL=0.000, + SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Bko8fvonLmUz for ; + Thu, 14 Jul 2016 17:23:26 -0700 (PDT) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id C19426DE00C9 + for ; Thu, 14 Jul 2016 17:23:26 -0700 (PDT) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) + id 1bNquA-0002Ty-K0; Thu, 14 Jul 2016 20:22:58 -0400 +Received: (nullmailer pid 29663 invoked by uid 1000); + Fri, 15 Jul 2016 00:23:20 -0000 +From: David Bremner +To: Daniel Kahn Gillmor , + Notmuch Mail +Subject: Re: [PATCH v4 09/16] index encrypted parts when asked. +In-Reply-To: <8737ncmbpy.fsf@alice.fifthhorseman.net> +References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net> + <1467970047-8013-10-git-send-email-dkg@fifthhorseman.net> + <87lh14e2x8.fsf@tesseract.cs.unb.ca> <8737ncmbpy.fsf@alice.fifthhorseman.net> +User-Agent: Notmuch/0.22+28~gb9bf3f4 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Thu, 14 Jul 2016 21:23:20 -0300 +Message-ID: <8760s7zr47.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Fri, 15 Jul 2016 00:23:36 -0000 + +Daniel Kahn Gillmor writes: + +> It makes no sense to stop indexing a message just because one of the +> parts failed to decrypt, so i'm not going to immediately return. +> +> I'm willing to accept that only the last log message will make it out to +> the caller, and i could track whether anything has been written to the +> log and change the return value in that case. would that be acceptable? +> + +That sounds like an improvement. Other options I can think of + + - accumulate an error string. With talloc_asprintf_append, this is + not _too_ terrible. Making a second logging function [1] that + didn't clear the log buffer but appended would maybe make sense + (aside from contradicting what I said in the previous message). + This would still need some status return to alert the caller. + + - Pass a logging callback; this requires API changes. We + already have a such a callback for notmuch_database_compact. + + +While thinking about this, I noticed several suspect uses of +_notmuch_database_log in current index.cc, at least in +_index_mime_part. These are probably my fault, resulting from +blindly replacing printfs. + +[1]: untested: + +void +_notmuch_database_log_append (notmuch_database_t *notmuch, + const char *format, + ...) +{ + va_list va_args; + + va_start (va_args, format); + + if (notmuch->status_string) + notmuch->status_string = talloc_vasprintf_append (notmuch->status_string, format, va_args) + else + notmuch->status_string = talloc_vasprintf (notmuch, format, va_args); + + va_end (va_args); +}