Subject: Re: [Patch] Fix reading from a tcp socket

Re: [Patch] Fix reading from a tcp socket

From: Ben Greear <greearb_at_candelatech.com>
Date: Wed, 25 Jul 2012 08:27:13 -0700

On 07/25/2012 01:29 AM, Ghennadi Procopciuc wrote:
> Hi all,
>
> We discovered a bug that occurs in two situations :
>
> 1.When many responses come simultaneously, c-ares reads only the first; after that,
> it awaits another notification for each of them. However, until a read does not return EAGAIN
>
> epoll does not send notifications for that socket anymore.
>
> 2.A big DNS message is divided in several IP packets, c-ares is expected to read
> the full message or to receive EAGAIN. This works appropriately for UDP but not TCP.
>
> I attached a patch that fixes these issues.

Maybe using a while loop would be a little more intuitive?

Thanks,
Ben

>
> Thanks,
> Ghennadi
>

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
Received on 2012-07-25