[Xitami-Dev] read_TCP returns 0 instead of -1

Fabien Royer xitami-dev@lists.xitami.org
Wed, 12 Jun 2002 11:37:35 -0400


Hi all,

As far as I am concerned, the bug is in read_TCP(). I had reported this 
problem to the Xitami team about 3-4 weeks ago. I guess I should have posted 
it here as well.

Regards,
Fabien.

>From: "D'Hoye, Peter" <PDHO@esko-graphics.com>
>Reply-To: xitami-dev@lists.xitami.org
>To: "'xitami-dev@lists.xitami.org'" <xitami-dev@lists.xitami.org>
>Subject: RE: [Xitami-Dev] read_TCP returns 0 instead of -1
>Date: Wed, 12 Jun 2002 11:08:50 +0200
>
>Rafael,
>
>thanks for this obvious fix. I'm using LRWP to create
>a web-interface for a machine we make, and I saw the
>LRWP client go in a loop when Xitami was restarted.
>I didn't have any time to investigate, thanks to you
>I can scratch another bug from my to-do list :-)
>
>PS: Pieter, we all mis Liberetto !!!
>
> > -----Original Message-----
> > From: Rafael Cano Pérez [mailto:rafael.cano@o-labs.com]
> > Sent: vrijdag 7 juni 2002 16:40
> > To: Xitami devel
> > Subject: [Xitami-Dev] read_TCP returns 0 instead of -1
> >
> >
> >
> >  Hello Imatix.
> >
> >  I am using lrwplib.c for a prototype LRWP application,
> >  wich will be later implementing the LRWP via an
> >  SMT agent.
> >
> >  In read_full_TCP() in lrwplib.c, after calling
> >  read_TCP() reads the return code, and compares
> >  it to SOCKET_ERROR for errors. This macro
> >  is defined in sfl.h as -1, but when the socket is
> >  closed, for example when xitami is closed, read_TCP
> >  returns 0, making any application based on lrwplib.c
> >  go into an infinite loop.
> >  Changing the test against 0
> >  ...
> >  if (chunkLen == 0)
> >   return SOCKET_ERROR;
> >  ...
> >
> >  fixes the error.
> >
> >  A bug in sfl.h, lrwplib.c or read_TCP() ??
>
>--
>Xitami-Dev -- Xitami Development Mailing List
>To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami-dev




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com