about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:05:17 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commitd7499f74c9eed7cebb6a4e273f04c854c1674c06 (patch)
treed20121ae821f483a4300361025e7d1089e6b2618 /t
parentd33fae954f99c7241be5ef6d6447db9bdc6d648d (diff)
downloadpublic-inbox-d7499f74c9eed7cebb6a4e273f04c854c1674c06.tar.gz
Supporting MSNs in long-lived connections beyond the lifetime of
a single request/response cycle is not scalable to a C10K
scenario.  It's probably not needed, since most clients seem to
use UIDs.

A somewhat efficient implementation I can come up uses
pack("S*" ...) (AKA "uint16_t mapping[50000]") has an overhead
of 100K per-client socket on a mailbox with 50K messages.  The
100K is a contiguous scalar, so it could be swapped out for
idle clients on most architectures if THP is disabled.

An alternative could be to use a tempfile as an allocator
partitioned into 100K chunks (or SQLite); but I'll only do that
if somebody presents a compelling case to support MSN SEARCH.
Diffstat (limited to 't')
-rw-r--r--t/imapd.t37
1 files changed, 0 insertions, 37 deletions
diff --git a/t/imapd.t b/t/imapd.t
index c7e0baaa..f5ca8b7e 100644
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -360,43 +360,6 @@ is(scalar keys %$ret, 3, 'got all 3 messages with comma-separated sequence');
 $ret = $mic->fetch_hash('1:*', 'RFC822') or BAIL_OUT "FETCH $@";
 is(scalar keys %$ret, 3, 'got all 3 messages');
 
-SKIP: {
-        # do any clients use non-UID IMAP SEARCH?
-        skip 'Xapian missing', 2 if $level eq 'basic';
-        my $x = $mic->search('all');
-        is_deeply($x, [1, 2, 3], 'MSN SEARCH works before rm');
-        $x = $mic->search(qw(header subject embedded));
-        is_deeply($x, [2], 'MSN SEARCH on Subject works before rm');
-}
-
-{
-        my $rdr = { 0 => \($ret->{1}->{RFC822}) };
-        my $env = { HOME => $ENV{HOME} };
-        my @cmd = qw(-learn rm --all);
-        run_script(\@cmd, $env, $rdr) or BAIL_OUT('-learn rm');
-}
-
-SKIP: {
-        # do any clients use non-UID IMAP SEARCH?  We only ensure
-        # MSN "SEARCH" can return a result which can be retrieved
-        # via MSN "FETCH"
-        skip 'Xapian missing', 3 if $level eq 'basic';
-        my $x = $mic->search(qw(header subject embedded));
-        is(scalar(@$x), 1, 'MSN SEARCH on Subject works after rm');
-        $x = $mic->message_string($x->[0]);
-        is($x, $ret->{2}->{RFC822}, 'message 2 unchanged');
-}
-
-my $r2 = $mic->fetch_hash('1:*', 'BODY.PEEK[]') or BAIL_OUT "FETCH $@";
-is(scalar keys %$r2, 2, 'did not get all 3 messages');
-is($r2->{1}->{'BODY[]'}, $ret->{2}->{RFC822}, 'message 2 unchanged');
-is($r2->{2}->{'BODY[]'}, $ret->{3}->{RFC822}, 'message 3 unchanged');
-$r2 = $mic->fetch_hash(2, 'BODY.PEEK[HEADER.FIELDS (message-id)]')
-                        or BAIL_OUT "FETCH $@";
-is($r2->{2}->{'BODY[HEADER.FIELDS (MESSAGE-ID)]'},
-        'Message-ID: <20200418222508.GA13918@dcvr>'."\r\n\r\n",
-        'BODY.PEEK[HEADER.FIELDS ...] drops .PEEK');
-
 {
         my @new_list = $mic->list;
         # tag differs in [-1]