summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/service
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-21 01:04:37 -0400
committerKali Kaneko <kali@leap.se>2014-01-21 12:20:06 -0400
commit22c106a7306446a3fa9689f5942a86a53ec884b4 (patch)
tree95b8b8bf480263e78b014250290c49bbdce94fea /src/leap/mail/imap/service
parent06e41f008d5e42f1fc0e535b6c882c78bac2ad96 (diff)
workaround for recursionlimit due to qtreactor
Diffstat (limited to 'src/leap/mail/imap/service')
-rw-r--r--src/leap/mail/imap/service/imap.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py
index a1d3ab7..ad22da6 100644
--- a/src/leap/mail/imap/service/imap.py
+++ b/src/leap/mail/imap/service/imap.py
@@ -49,6 +49,25 @@ from leap.common.events.events_pb2 import IMAP_SERVICE_STARTED
from leap.common.events.events_pb2 import IMAP_SERVICE_FAILED_TO_START
from leap.common.events.events_pb2 import IMAP_CLIENT_LOGIN
+######################################################
+# Temporary workaround for RecursionLimit when using
+# qt4reactor. Do remove when we move to poll or select
+# reactor, which do not show those problems. See #4974
+import resource
+import sys
+
+try:
+ sys.setrecursionlimit(10**6)
+except Exception:
+ print "Error setting recursion limit"
+try:
+ # Increase max stack size from 8MB to 256MB
+ resource.setrlimit(resource.RLIMIT_STACK, (2**28, -1))
+except Exception:
+ print "Error setting stack size"
+
+######################################################
+
class LeapIMAPServer(imap4.IMAP4Server):
"""
@@ -118,14 +137,10 @@ class LeapIMAPServer(imap4.IMAP4Server):
method
"""
from twisted.internet import reactor
- log.msg("LEAP Overwritten fetch...")
if not query:
self.sendPositiveResponse(tag, 'FETCH complete')
return # XXX ???
- print "QUERY ", query
- print query[0]
-
cbFetch = self._IMAP4Server__cbFetch
ebFetch = self._IMAP4Server__ebFetch