Merge branch 'master' into next
Conflicts: Changelog.draft.rst offlineimap/imapserver.py
This commit is contained in:
commit
7b8d7501d1
@ -33,6 +33,7 @@ Changes
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
* Fix hang because of infinite loop reading EOF.
|
||||
* Allow SSL connections to send keep-alive messages.
|
||||
* Fix regression (UIBase is no more).
|
||||
* Make profiling mode really enforce single-threading
|
||||
|
@ -47,7 +47,10 @@ class IMAP4_Tunnel(IMAP4):
|
||||
def read(self, size):
|
||||
retval = ''
|
||||
while len(retval) < size:
|
||||
retval += self.infd.read(size - len(retval))
|
||||
buf = self.infd.read(size - len(retval))
|
||||
if not buf:
|
||||
break
|
||||
retval += buf
|
||||
return retval
|
||||
|
||||
def readline(self):
|
||||
@ -204,6 +207,8 @@ class WrappedIMAP4_SSL(IMAP4_SSL):
|
||||
read = 0
|
||||
while read < n:
|
||||
data = self._read_upto (n-read)
|
||||
if not data:
|
||||
break
|
||||
read += len(data)
|
||||
chunks.append(data)
|
||||
|
||||
@ -216,6 +221,8 @@ class WrappedIMAP4_SSL(IMAP4_SSL):
|
||||
retval = ''
|
||||
while 1:
|
||||
linebuf = self._read_upto(1024)
|
||||
if not linebuf:
|
||||
return retval
|
||||
nlindex = linebuf.find("\n")
|
||||
if nlindex != -1:
|
||||
retval += linebuf[:nlindex + 1]
|
||||
|
@ -70,6 +70,8 @@ class UsefulIMAP4(UsefulIMAPMixIn, imaplibutil.WrappedIMAP4):
|
||||
io = StringIO()
|
||||
while read < size:
|
||||
data = imaplib.IMAP4.read (self, min(size-read, 65536))
|
||||
if not data:
|
||||
break
|
||||
read += len(data)
|
||||
io.write(data)
|
||||
return io.getvalue()
|
||||
|
Loading…
Reference in New Issue
Block a user