<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/database.cc, branch debian/0.13_rc1-2</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=debian%2F0.13_rc1-2</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=debian%2F0.13_rc1-2'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2012-05-05T13:12:26Z</updated>
<entry>
<title>lib/cli: Make notmuch_database_create return a status code</title>
<updated>2012-05-05T13:12:26Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-04-30T16:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=ba5729421825e0ec9d38aa9d656553f329aa6f09'/>
<id>urn:sha1:ba5729421825e0ec9d38aa9d656553f329aa6f09</id>
<content type='text'>
This is the notmuch_database_create equivalent of the previous change.

In this case, there were places where errors were not being propagated
correctly in notmuch_database_create or in calls to it.  These have
been fixed, using the new status value.
</content>
</entry>
<entry>
<title>lib/cli: Make notmuch_database_open return a status code</title>
<updated>2012-05-05T13:11:57Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-04-30T16:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5fddc07dc31481453c1af186bf7da241c00cdbf1'/>
<id>urn:sha1:5fddc07dc31481453c1af186bf7da241c00cdbf1</id>
<content type='text'>
It has been a long-standing issue that notmuch_database_open doesn't
return any indication of why it failed.  This patch changes its
prototype to return a notmuch_status_t and set an out-argument to the
database itself, like other functions that return both a status and an
object.

In the interest of atomicity, this also updates every use in the CLI
so that notmuch still compiles.  Since this patch does not update the
bindings, the Python bindings test fails.
</content>
</entry>
<entry>
<title>Split notmuch_database_close into two functions</title>
<updated>2012-04-28T12:21:13Z</updated>
<author>
<name>Justus Winter</name>
<email>4winter@informatik.uni-hamburg.de</email>
</author>
<published>2012-04-25T13:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7864350c938944276c1a378539da7670c211b9b5'/>
<id>urn:sha1:7864350c938944276c1a378539da7670c211b9b5</id>
<content type='text'>
Formerly notmuch_database_close closed the xapian database and
destroyed the talloc structure associated with the notmuch database
object. Split notmuch_database_close into notmuch_database_close and
notmuch_database_destroy.

This makes it possible for long running programs to close the xapian
database and thus release the lock associated with it without
destroying the data structures obtained from it.

This also makes the api more consistent since every other data
structure has a destructor function.

The comments in notmuch.h are a courtesy of Austin Clements.

Signed-off-by: Justus Winter &lt;4winter@informatik.uni-hamburg.de&gt;
</content>
</entry>
<entry>
<title>Fix error reporting in notmuch_database_find_message_by_filename</title>
<updated>2012-03-18T10:58:35Z</updated>
<author>
<name>Justus Winter</name>
<email>4winter@informatik.uni-hamburg.de</email>
</author>
<published>2012-03-17T16:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=ea54c4fdc7d0ed9a4d6ab328d44c10ce5668d587'/>
<id>urn:sha1:ea54c4fdc7d0ed9a4d6ab328d44c10ce5668d587</id>
<content type='text'>
Formerly it was possible for *message_ret to be left
uninitialized. The documentation however clearly states that "[o]n any
failure or when the message is not found, this function initializes
'*message' to NULL".

Signed-off-by: Justus Winter &lt;4winter@informatik.uni-hamburg.de&gt;
</content>
</entry>
<entry>
<title>Actually close the xapian database in notmuch_database_close</title>
<updated>2012-03-03T15:30:07Z</updated>
<author>
<name>Justus Winter</name>
<email>4winter@informatik.uni-hamburg.de</email>
</author>
<published>2012-03-02T14:58:39Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=cfc5f1059aa16753cba610c41601cacc97260e08'/>
<id>urn:sha1:cfc5f1059aa16753cba610c41601cacc97260e08</id>
<content type='text'>
Formerly the xapian database object was deleted and closed in its
destructor once the object was garbage collected. Explicitly call
close() so that the database and the associated lock is released
immediately.

The comment is a courtesy of Austin Clements.

Signed-off-by: Justus Winter &lt;4winter@informatik.uni-hamburg.de&gt;
</content>
</entry>
<entry>
<title>Prevent segmentation fault in notmuch_database_close</title>
<updated>2012-02-21T03:03:25Z</updated>
<author>
<name>Justus Winter</name>
<email>4winter@informatik.uni-hamburg.de</email>
</author>
<published>2012-02-18T23:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=e2e95caa51f8c1ea57b4fc7d3926fda1fb1aed10'/>
<id>urn:sha1:e2e95caa51f8c1ea57b4fc7d3926fda1fb1aed10</id>
<content type='text'>
Previously opening a notmuch database in read write mode that has been
locked resulted in the notmuch_database_open function executing
notmuch_database_close as a cleanup function. notmuch_database_close
failed to check whether the xapian database has in fact been created.

Add a check whether the xapian database object has actually been
created before trying to call its flush method.

Signed-off-by: Justus Winter &lt;4winter@informatik.uni-hamburg.de&gt;
</content>
</entry>
<entry>
<title>lib: Use talloc to simplify cleanup in notmuch_database_open</title>
<updated>2012-02-04T01:15:45Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-01-29T05:50:10Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=c32116d04807eec475d7e19bb6723c35bc399059'/>
<id>urn:sha1:c32116d04807eec475d7e19bb6723c35bc399059</id>
<content type='text'>
Previously, we manually "free"d various pointers in
notmuch_database_open.  Use a local talloc context instead to simplify
cleanup and eliminate various NULL pointer initializations and
conditionals.
</content>
</entry>
<entry>
<title>lib: Release resources if notmuch_database_open fails</title>
<updated>2012-02-04T01:15:26Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-01-29T05:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=6c0adab23eadb81bb1254f4b82175902df11bb3f'/>
<id>urn:sha1:6c0adab23eadb81bb1254f4b82175902df11bb3f</id>
<content type='text'>
Previously, if a Xapian exception occurred in notmuch_database_open,
we failed to clean up the allocated notmuch_database_t object.
</content>
</entry>
<entry>
<title>lib: Don't delete uninitialized pointers</title>
<updated>2012-02-04T01:14:59Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@MIT.EDU</email>
</author>
<published>2012-01-29T05:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a8ee1c75c348f41d88398fc394812e66e8e8b72e'/>
<id>urn:sha1:a8ee1c75c348f41d88398fc394812e66e8e8b72e</id>
<content type='text'>
In the error-handling paths of notmuch_database_open, we call
notmuch_database_close, which "delete"s several objects referenced by
the notmuch_database_t object.  However, some of these pointers may be
uninitialized, resulting in undefined behavior.  Hence, allocate the
notmuch_database_t with talloc_zero to make sure these pointers are
NULL so that "delete"ing them is harmless.
</content>
</entry>
<entry>
<title>lib: call g_mime_init() from notmuch_database_open()</title>
<updated>2012-01-01T03:08:15Z</updated>
<author>
<name>Kazuo Teramoto</name>
<email>kaz.rag@gmail.com</email>
</author>
<published>2011-12-31T04:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=442d405ad301bd0bc9dc1d385c21f943ba743308'/>
<id>urn:sha1:442d405ad301bd0bc9dc1d385c21f943ba743308</id>
<content type='text'>
As reported in
id:"CAEbOPGyuHnz4BPtDutnTPUHcP3eYcRCRkXhYoJR43RUMw671+g@mail.gmail.com"
sometimes gmime tries to access a NULL pointer, e.g. g_mime_iconv_open()
tries to access iconv_cache that is NULL if g_mime_init() is not called.
This causes notmuch to segfault when calling gmime functions.

Calling g_mime_init() initializes iconv_cache and others variables needed
by gmime, making sure they are initialized when notmuch calls gmime
functions.

Test marked fix by db.
</content>
</entry>
</feed>
