[PATCH] Re: fix hang because of infinite loop reading EOF

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Mar 7 20:59:22 GMT 2011


On Thu, Mar 03, 2011 at 05:48:26PM +0800, Haojun Bao wrote:
> Sebastian Spaeth <Sebastian at SSpaeth.de> writes:
> 
> > On Thu, 03 Mar 2011 10:46:33 +0800, Haojun Bao <baohaojun at gmail.com> wrote:
> >> Offlineimap sometimes hangs when downloading gmail with large
> >> attachment.
> >> 
> >> This is because of several infinite loop when reading the socket while
> >> the EOF has happened. It can be seen from 2 facts:
> >
> > Hi,
> >
> > I think your patch might be safe and should most probably be included
> > (with some comment in the code explaining why we need that check and
> > abort I guess). 
> 
> Yeah, I think so too. It's the right thing to do. It should be the
> semantics of the read method. 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''.

Patch applied on master. I've tweak the message commit and updated the
Changelog, though.

Thanks.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list