docker-offlineimap/offlineimap
Haojun Bao b94bf79258 fix hang because of infinite loop reading EOF
Read() should return empty string when EOF happen, instead of looping
forever. This is the right semantics of read(), and a wrapped version
should not change it.

If you read the read(2) system call manpage, it tells you that when EOF
is seen, return value is 0; it does not say

	``loop forever when EOF happen''.

After the EOF detection is patched you can see the
following exception:

  WARNING: ERROR attempting to copy message 344 for account Gmail:Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/offlineimap/folder/Base.py", line 282, in copymessageto
      message = self.getmessage(uid)
    File "/usr/lib/pymodules/python2.6/offlineimap/folder/IMAP.py", line 216, in getmessage
      initialresult = imapobj.uid('fetch', '%d' % uid, '(BODY.PEEK[])')
    File "/usr/lib/python2.6/imaplib.py", line 753, in uid
      typ, dat = self._simple_command(name, command, *args)
    File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
      return self._command_complete(name, self._command(name, *args))
    File "/usr/lib/python2.6/imaplib.py", line 890, in _command_complete
      raise self.abort('command: %s => %s' % (name, val))
  abort: command: UID => socket error: EOF

Signed-off-by: Bao Haojun <baohaojun@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-03-07 21:54:28 +01:00
..
folder Use self.ui rather than UIBase.getglobalui() 2011-02-17 19:03:29 +01:00
repository repository/Base.py: Fix regression (UIBase is no more) 2011-03-01 18:36:57 +01:00
ui restore compatibilty with python 2.5 for ui TTY 2011-02-18 20:00:19 +01:00
__init__.py v6.3.2 2011-02-21 12:26:48 +01:00
accounts.py Better trace information when an exception is caught. 2011-01-28 19:35:21 +01:00
CustomConfig.py Improve CustomConfig documentation 2011-01-20 19:46:01 +01:00
imaplibutil.py fix hang because of infinite loop reading EOF 2011-03-07 21:54:28 +01:00
imapserver.py fix hang because of infinite loop reading EOF 2011-03-07 21:54:28 +01:00
imaputil.py Replace UIBase.getglobalui() with getglobalui() 2011-01-05 19:24:00 +01:00
init.py Make profiling mode really enforce singlethreading 2011-03-03 19:08:49 +01:00
localeval.py Update FSF address 2006-08-12 05:15:55 +01:00
mbnames.py Update FSF address 2006-08-12 05:15:55 +01:00
syncmaster.py Implement true single-threading 2011-01-14 19:25:11 +01:00
threadutil.py Remove MultiLock implementation 2011-01-25 19:19:14 +01:00