Subject: Re: [Patch] Fix for TCP reads in 1.3.0 (and current trunk)

Re: [Patch] Fix for TCP reads in 1.3.0 (and current trunk)

From: Brad Spencer <spencer_at_jacknife.org>
Date: Fri, 25 Aug 2006 19:54:48 -0300

I was upgrading to v1.3.1 and noticed that I still needed to apply
this and another patch that I sent in for ares_version.h. I checked
the trunk version and it looks like these issues still exist there,
too.

Original posts:

http://daniel.haxx.se/projects/c-ares/mail/c-ares-archive-2006-02/0000.shtml
http://daniel.haxx.se/projects/c-ares/mail/c-ares-archive-2006-02/0004.shtml

On Thu, Feb 09, 2006 at 12:22:16AM -0400, spencer wrote:
> First of all, thanks very much for the work on this asynchronous DNS
> library with a sane license. It fit right into my needs (probably
> because my needs almost entirely align with what's on the c-ares "why"
> page :)
>
> Ok, I'll grab your attention with a serious bug-fix first. TCP reads
> don't work, at least the ones I was trying (with ARES_FLAG_STAYOPEN
> on). This is simply because the current TCP read buffer position is
> not reset after a successful request. The tcp_lenbuf_pos is, but
> tcp_buffer_pos isn't and since that's what drives the calls to
> recvfrom(), that's not cool. I actually tracked this down very easily
> with a little dose of valgrind. See the attached patch.
>
> While we're at it, I've also attached a tiny change that removes
> uninitialized variable warnings by gcc-4.0.1. I always compile
> everything with -Werror (call me crazy), so I had to "fix" them
> anyway, so everyone may as well benefit.

-- 
----------------------------------------------------------
Brad Spencer - spencer@jacknife.org - http://jacknife.org/

Received on 2006-08-26