notmuch/lib
Carl Worth 7b78eb4af6 Add support (and tests) for messages with really long message IDs.
Scott Henson reported an internal error that occurred when he tried to
add a message that referenced another message with a message ID well
over 300 characters in length. The bug here was running into a Xapian
limit for the length of metadata key names, (which is even more
restrictive than the Xapian limit for the length of terms).

We fix this by noticing long message ID values and instead using a
message ID of the form "notmuch-sha1-<sha1_sum_of_message_id>". That
is, we use SHA1 to generate a compressed, (but still unique), version
of the message ID.

We add support to the test suite to exercise this fix. The tests add a
message referencing the long message ID, then add the message with the
long message ID, then finally add another message referencing the long
ID. Each of these tests exercise different code paths where the
special handling is implemented.

A final test ensures that all three messages are stitched together
into a single thread---guaranteeing that the three code paths all act
consistently.
2010-06-04 13:35:07 -07:00
..
database-private.h Avoid database corruption by not adding partially-constructed mail documents. 2010-06-04 10:16:53 -07:00
database.cc Add support (and tests) for messages with really long message IDs. 2010-06-04 13:35:07 -07:00
directory.cc Avoid database corruption by not adding partially-constructed mail documents. 2010-06-04 10:16:53 -07:00
index.cc Do not segfault on empty mime parts 2010-04-13 08:49:06 -07:00
libsha1.c libify: Move library sources down into lib directory. 2009-11-09 16:24:03 -08:00
libsha1.h libify: Move library sources down into lib directory. 2009-11-09 16:24:03 -08:00
Makefile Makefiles: Use .DEFAULT to support arbitrary targets from sub directories. 2010-01-06 10:32:06 -08:00
Makefile.local Add support for the Solaris platform 2010-06-03 18:17:03 -07:00
message-file.c Make Received: header special in notmuch_message_file_get_header 2010-04-26 14:44:06 -07:00
message.cc Avoid database corruption by not adding partially-constructed mail documents. 2010-06-04 10:16:53 -07:00
messages.c lib: Rename iterator functions to prepare for reverse iteration. 2010-03-09 09:22:29 -08:00
notmuch-private.h Add support (and tests) for messages with really long message IDs. 2010-06-04 13:35:07 -07:00
notmuch.h lib: Ensure notmuch_query_search_messages returns NULL on an exception. 2010-04-24 07:27:50 -07:00
query.cc lib: Ensure notmuch_query_search_messages returns NULL on an exception. 2010-04-24 07:27:50 -07:00
sha1.c Typsos 2009-11-18 03:21:36 -08:00
tags.c lib: Rename iterator functions to prepare for reverse iteration. 2010-03-09 09:22:29 -08:00
thread.cc Fix SEGV in _thread_cleanup_author if author ends with ', ' 2010-04-27 16:34:27 -07:00
xutil.c xutil: Implement xstrndup without relying on strndup. 2009-12-01 12:51:39 -08:00
xutil.h libify: Move library sources down into lib directory. 2009-11-09 16:24:03 -08:00