#1152 cURL > 7.21.7 breaks compatiblity with c-ares < 1.6.1

closed-fixed
5
2013-06-21
2012-10-16
Kim Vandry
No

libcurl versions greatet than 7.21.7 including the current version 7.27.0 no longer function with c-ares versions between 1.5.0 and 1.6.0.

The problem was introduced in the following commit:

commit ca015f1a45c68aa1d641678cfc13ce0df0c58fe0
Author: Vsevolod Novikov <novikov@doroga.tv>
Date: Sat Jan 29 20:12:10 2011 +0100

In file lib/asyn-ares.c:

Curl uses the macro ARES_VERSION to decide the value of macro HAVE_CARES_CALLBACK_TIMEOUTS, which affects whether to use a new style or old style prototype for "query_completed_cb". This macro is defines in <ares_version.h>. Curl does not include this header directly, it only includes <ares.h>.

In newer versions of c-ares, <ares.h> includes <ares_version.h> itself, so there is no problem.

In older versions of c-ares, <ares.h> does not include <ares_version.h>, so the macro ARES_VERSION stays undefined. If the actual version of c-ares is 1.5.x or 1.6.0, this means that the wrong prototype is used for query_completed_cb. The compiler issues a warning but it is easy to miss that. The end result is that no host lookups work. (Crashes are also possible.)

Proposed solutions (one or the other):

- Re-add #include <ares_version.h> in asyn-ares.h after #include <ares.h>

- Drop support for versions of c-ares less than 1.6.1 and update the file lib/README.ares and m4/curl-confopts.m4 to reflect this.

-v

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2012-10-23
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks