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