Re: [PATCH v4 02/16] Move crypto.c into libutil
[notmuch-archives.git] / 28 / 659ae537481ae685f9e7f5bf5684b843dfcdb1
1 Return-Path: <alpine.art.de@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 596C26DE1830\r
6  for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:24:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.875\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.875 tagged_above=-999 required=5 tests=[AWL=1.695, \r
12  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
14  RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id H8U0NVBAdwZS for <notmuch@notmuchmail.org>;\r
18  Sun, 28 Feb 2016 06:24:07 -0800 (PST)\r
19 Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com\r
20  [74.125.82.42]) by arlo.cworth.org (Postfix) with ESMTPS id A22A46DE17AE for\r
21  <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:24:06 -0800 (PST)\r
22 Received: by mail-wm0-f42.google.com with SMTP id p65so15103737wmp.0\r
23  for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:24:06 -0800 (PST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
25  h=date:from:subject:to:references:in-reply-to:user-agent:message-id\r
26  :mime-version:content-transfer-encoding;\r
27  bh=/yX5NGSlt/WEibkuPr4nvun7SraXBSWzDpyRbKiugE8=;\r
28  b=zJO64/Y2+mS/I13cIV0HRuURgBXL/Fb97nfSBmy6jc+/BzBJda5vzp1M2JDI8dp/5z\r
29  ZIxiqAozWM1A4/jQ5mpoFcdLhcmMHhlEx7CIxKaDkz4M3yRTJ/615ch3gq7E6of227B/\r
30  3fhiD9RgV5429CHYtABvLt8IOYpKh/NHJQyvWKzCT5tFiQy2Zrdo6kM1u5YNuMhywpda\r
31  MbdD0xOHiVnjj6HmXKJtDZTKtb18hViH3bJOrtehTFAOt60SQsFQD0fHKb04+z5pbMvR\r
32  uH75a/PZHLZ4C4Wc2Um8F0ROhJI50L3SXY6nbmlcEyispQWORB2AXUS7iPPX85Ewku2v\r
33  dBLg==\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
35  d=1e100.net; s=20130820;\r
36  h=x-gm-message-state:date:from:subject:to:references:in-reply-to\r
37  :user-agent:message-id:mime-version:content-transfer-encoding;\r
38  bh=/yX5NGSlt/WEibkuPr4nvun7SraXBSWzDpyRbKiugE8=;\r
39  b=CzTGewVA4Zuo5uf1lnK3a5WxzSoPK2ZadYEpWxNCHbfA1fuzTxqxZyUrloZ/zeyPYW\r
40  wd1ZKodg74yOSBrvwc9c3i6Ndrr49FIfqcOYebJQguVTG9RIXDkZ2S1pUeeG2w1HIulU\r
41  xynyFWFd8MMBlvSDx1K8jwG8PiLkMh7asq0jEfSJ7U5LWcC+6E/iJC3bZ/6m23tO5wOf\r
42  zl3HyClBJTp08lAPcLJgAMSif3usO+28sRy0rpC8XeG5X3W/QLbPeGmPBKfQLdxsU4zY\r
43  QZHjDhe4yA3wgddaaoh2se5wlcXhUHVvq1jIn7qbr877ZiaY1yhCQ/9nptN+ng6aBzuF\r
44  ujug==\r
45 X-Gm-Message-State:\r
46  AD7BkJIV9btjbTP1pAm0RAB1s21yu6udAflvwBxD5oRi6U+4EkM+zbeMWmGDToqiQp0QzQ==\r
47 X-Received: by 10.194.103.198 with SMTP id fy6mr12474621wjb.48.1456669444610; \r
48  Sun, 28 Feb 2016 06:24:04 -0800 (PST)\r
49 Received: from localhost (p579BA378.dip0.t-ipconnect.de. [87.155.163.120])\r
50  by smtp.gmail.com with ESMTPSA id ka7sm21325925wjb.8.2016.02.28.06.24.03\r
51  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
52  Sun, 28 Feb 2016 06:24:03 -0800 (PST)\r
53 Date: Sun, 28 Feb 2016 14:26:05 +0000\r
54 From: Franz Fellner <alpine.art.de@gmail.com>\r
55 Subject: Re: need to call notmuch_threads_get (..) to actually move iterator\r
56 To: Gaute Hope <eg@gaute.vetsj.com>, notmuch@notmuchmail.org\r
57 References: <1456315381-astroid-1-8aih8mdal8-11676@strange>\r
58 In-Reply-To: <1456315381-astroid-1-8aih8mdal8-11676@strange>\r
59 User-Agent: astroid/v0.5-61-gab5b649c (https://github.com/gauteh/astroid)\r
60 Message-Id: <1456669181-astroid-0-hsim583msj-27330@TP_L520>\r
61 MIME-Version: 1.0\r
62 Content-Type: text/plain; charset=utf-8; format=flowed\r
63 Content-Transfer-Encoding: quoted-printable\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.20\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68  <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
70  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
75  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Sun, 28 Feb 2016 14:24:09 -0000\r
77 \r
78 It might be I found the issue:\r
79 One big thing notmuch_threads_get does is remove the thread_id from the\r
80 match_set. Playing with astroid (branch ti-skip-and-load) i see that it\r
81 is not entirely true that the iterator doesn't move. It just seems to\r
82 duplicate some messages. There definitely are coming new messages.\r
83 So my explanation is that match_set contains duplicate thread_ids. If\r
84 that is true a solution to Gautes problem might be to deduplicate the\r
85 match_set.\r
86 \r
87 Excerpts from Gaute Hope's message of Februar 24, 2016 1:08 :\r
88 > Hi,\r
89 >=20\r
90 > it seems to be necessary to actually call notmuch_threads_get (threads)\r
91 > to move the thread iterator from a query object, just calling\r
92 > notmuch_threads_move_to_next (..) is not enough:\r
93 >=20\r
94 > ```\r
95 >=20\r
96 > notmuch_query_t *query;\r
97 > notmuch_threads_t *threads;\r
98 > notmuch_thread_t *thread;\r
99 >=20\r
100 > query =3D notmuch_query_create (database, query_string);\r
101 > threads =3D notmuch_query_search_threads (query);\r
102 >=20\r
103 > int i =3D 0;\r
104 >=20\r
105 > for (;\r
106 >      notmuch_threads_valid (threads);\r
107 >      notmuch_threads_move_to_next (threads))\r
108 > {\r
109 >     /*\r
110 >      * with this line commented out the iterator seems to remain in\r
111 >      * place, and if I below do another loop it will start from the\r
112 >      * beginning.\r
113 >=20\r
114 >     thread =3D notmuch_threads_get (threads);\r
115 >     ....\r
116 >     notmuch_thread_destroy (thread);\r
117 >     */\r
118 >=20\r
119 >     i++;\r
120 >     if (i > 100) break;\r
121 > }\r
122 >=20\r
123 > for (;\r
124 >      notmuch_threads_valid (threads);\r
125 >      notmuch_threads_move_to_next (threads))\r
126 > {\r
127 >     /* the thread acquired here will be the first thread in the query.\r
128 >      * it should be the 101th. */\r
129 >=20\r
130 >     thread =3D notmuch_threads_get (threads);\r
131 >     ....\r
132 >     notmuch_thread_destroy (thread);\r
133 >=20\r
134 > }\r
135 >=20\r
136 >=20\r
137 > notmuch_query_destroy (query);\r
138 > ```\r
139 >=20\r
140 > It is quite slow to skip the threads in this way, might it be faster if\r
141 > move_to_next works correctly?\r
142 >=20\r
143 > Regards, Gaute\r
144 >=20\r
145 > _______________________________________________\r
146 > notmuch mailing list\r
147 > notmuch@notmuchmail.org\r
148 > https://notmuchmail.org/mailman/listinfo/notmuch\r
149 >=20\r
150 =\r