diff options
author | Kali Kaneko <kali@leap.se> | 2014-02-11 02:53:28 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-02-17 11:39:49 -0400 |
commit | fd9c8c2e3c88476b90805b689f6914fe5eac16df (patch) | |
tree | 36a7079f8f10d71d67abbb945612e1588864b922 /src/leap/mail/imap/server.py | |
parent | 04dfa3afdbb2080c717bfd32d6e47641615967fc (diff) |
defer fetch to thread
also, dispatch query for all headers to its own method.
Diffstat (limited to 'src/leap/mail/imap/server.py')
-rw-r--r-- | src/leap/mail/imap/server.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py index 3497a8b..7c09784 100644 --- a/src/leap/mail/imap/server.py +++ b/src/leap/mail/imap/server.py @@ -119,15 +119,14 @@ class LeapIMAPServer(imap4.IMAP4Server): cbFetch, tag, query, uid ).addErrback(ebFetch, tag) - # XXX not implemented yet --- should hit memstore - #elif len(query) == 1 and str(query[0]) == "rfc822.header": - #self._oldTimeout = self.setTimeout(None) + elif len(query) == 1 and str(query[0]) == "rfc822.header": + self._oldTimeout = self.setTimeout(None) # no need to call iter, we get a generator - #maybeDeferred( - #self.mbox.fetch_headers, messages, uid=uid - #).addCallback( - #cbFetch, tag, query, uid - #).addErrback(ebFetch, tag) + maybeDeferred( + self.mbox.fetch_headers, messages, uid=uid + ).addCallback( + cbFetch, tag, query, uid + ).addErrback(ebFetch, tag) else: self._oldTimeout = self.setTimeout(None) # no need to call iter, we get a generator |