[PATCH] lib: Invalidate message metadata in _notmuch_message_gen_terms
authorAustin Clements <amdragon@MIT.EDU>
Fri, 1 Aug 2014 02:59:27 +0000 (22:59 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:03 +0000 (10:04 -0800)
da/ef191b015313e9660d44c488f92fae2ed3eb25 [new file with mode: 0644]

diff --git a/da/ef191b015313e9660d44c488f92fae2ed3eb25 b/da/ef191b015313e9660d44c488f92fae2ed3eb25
new file mode 100644 (file)
index 0000000..0817ac3
--- /dev/null
@@ -0,0 +1,100 @@
+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 16CCA431FC9\r
+       for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:59:43 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 xygbLv0hJxJR for <notmuch@notmuchmail.org>;\r
+       Thu, 31 Jul 2014 19:59:38 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
+       [18.7.68.37])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id BD0A1431FBF\r
+       for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:59:38 -0700 (PDT)\r
+X-AuditID: 12074425-f79766d000006da8-ba-53db02990f82\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id F2.1C.28072.9920BD35; Thu, 31 Jul 2014 22:59:37 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s712xZ1d012352; \r
+       Thu, 31 Jul 2014 22:59:36 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s712xXLR010585\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 31 Jul 2014 22:59:35 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1XD344-0004XL-6v; Thu, 31 Jul 2014 22:59:28 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] lib: Invalidate message metadata in\r
+ _notmuch_message_gen_terms\r
+Date: Thu, 31 Jul 2014 22:59:27 -0400\r
+Message-Id: <1406861967-17404-1-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsUixCmqrTuT6XawwZadnBbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXRs/uC2wFd9kq7q38y9jAeIy1i5GTQ0LAROLyzNvMELaYxIV7\r
+       69m6GLk4hARmM0l0bZzJAuFsZJRYfOUKK4Rzh0li5vkfjCAtQgJzGSVOXPAGsdkENCS27V8O\r
+       FhcRkJbYeXc2UAMHB7OAmsSfLhWQsLCAv8S+ideYQGwWAVWJaZOnsoGU8Ao4SFxf5QtxhJxE\r
+       w41PbBMYeRcwMqxilE3JrdLNTczMKU5N1i1OTszLSy3StdDLzSzRS00p3cQICgF2F9UdjBMO\r
+       KR1iFOBgVOLhdQi9FSzEmlhWXJl7iFGSg0lJlLfvP1CILyk/pTIjsTgjvqg0J7X4EKMEB7OS\r
+       CO/LD0A53pTEyqrUonyYlDQHi5I471trq2AhgfTEktTs1NSC1CKYrAwHh5IE7wnG28FCgkWp\r
+       6akVaZk5JQhpJg5OkOE8QMOngNTwFhck5hZnpkPkTzEac1yYeaqNiWPR/pfdTEIsefl5qVJA\r
+       yxiASgVASjNK8+CmweL4FaM40HPCvAtBBvIAUwDcvFdAq5iAVj2/dR1kVUkiQkqqgTGyKr41\r
+       /Opr0yKl1C6vP+3TGddt//Xkt6jyL43a/tnrXm2VCF5yyD+84NSxR6+PrDfdu+dT8Rox5UUH\r
+       zpwTdDP+y/zT68zZN+cqtlv7mcUHnWZbYrDv4zcrnw+NPNvv61e7uG2sWfOIJfW+R6ty99K/\r
+       Fxl1HLZJ3lN2tTU5nX1/8eNJdhHMr98qsRRnJBpqMRcVJwIA7zv3pr4CAAA=\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: Fri, 01 Aug 2014 02:59:43 -0000\r
+\r
+Previously, we invalidated stored message metadata in\r
+_notmuch_message_add_term and _notmuch_message_remove_term, but not in\r
+_notmuch_message_gen_terms.  This doesn't currently result in any bugs\r
+because of our limited uses of _notmuch_message_gen_terms, but it may\r
+could cause trouble in the future.\r
+---\r
+ lib/message.cc | 2 ++\r
+ 1 file changed, 2 insertions(+)\r
+\r
+diff --git a/lib/message.cc b/lib/message.cc\r
+index 1618e81..cde6a1c 100644\r
+--- a/lib/message.cc\r
++++ b/lib/message.cc\r
+@@ -1049,6 +1049,8 @@ _notmuch_message_gen_terms (notmuch_message_t *message,\r
+       /* Create a gap between this an the next terms so they don't\r
+        * appear to be a phrase. */\r
+       message->termpos = term_gen->get_termpos () + 100;\r
++\r
++      _notmuch_message_invalidate_metadata (message, prefix_name);\r
+     }\r
\r
+     term_gen->set_termpos (message->termpos);\r
+-- \r
+2.0.0\r
+\r