Re: [gnet-dev] [PATCH] examples/echoserver-async.c should check condition G_IO_OUT first



On Sun, 2005-11-20 at 21:14 +1100, Benjamin Lee wrote:

Hi Benjamin,

> I just noticed that the examples/echoserver-async.c program has a
> small corner condition bug.
> 
> If it receives some data... and then it receives a read 0 bytes... it
> will not echo the received data it previously read... because it
> thinks the other side wants to disconnect... when, although this is
> true, it should really send the data back first (or try to), then
> disconnect.
> 
> I've attached a trivial patch which swaps the check for G_IO_IN and
> G_IO_OUT flags / events... which _should_ handle this condition.
> 
> Comments?

Makes sense, looks good, and 'make check' still passes. Committed to
CVS. Thanks for the patch and sorry for the delayed response.

Cheers
 -Tim





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]