On Fri, 17 Dec 2010 09:41:06 +0100
Sebastian Dransfeld <[email protected]> wrote:

> On 12/17/2010 09:06 AM, Sebastian Dransfeld wrote:
> > On 12/17/2010 05:30 AM, Mike McCormack wrote:
> >> On 12/17/2010 05:41 AM, Sebastian Dransfeld wrote:
> >>
> >>>>              num = read(svr->fd, buf, sizeof(buf));
> >>>> -        if ((num>     0) || (errno == EAGAIN))
> >>>> +        if ((num>= 0) || (errno == EAGAIN))
> >>>>                lost_server = EINA_FALSE;
> >>>
> >>> Sure this is right? a ret 0 an errno != EAGAIN is probably a lost server.
> >>
> >> 0 is a successful return, so errno is not set in that case.
> >>
> >> The above fix looks correct to me.
> >
> > Depends on how the main loop works. We had this discussion a while ago,
> > and the result was:
> >
> > http://trac.enlightenment.org/e/changeset/54209/trunk/ecore/src/lib/ecore_con/ecore_con.c
> >
> 
> And:
> 
> http://stackoverflow.com/questions/2416944/can-read-function-on-a-connected-socket-return-zero-bytes
> 
> So 0 is _not_ a valid return value on a tcp socket.
> 
> S.
I just added notes to the ssl_read returns to avoid someone changing them
because of this in the future.

-- 
Mike Blumenkrantz
Zentific: We run the three-legged race individually.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to