diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-12-01 19:06:24 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-12-01 19:06:24 +0000 |
commit | 39eb96e9ffa4ba768223383351dd3c0447163ee5 (patch) | |
tree | b922b7df251e9828acce993172e50b065fc80da0 /ares | |
parent | 4c84f6b423127dab15bb42bd63135449c1601a2a (diff) |
Convert the public config struct to the same binary size/construct as in the
latest releases to remain ABI compatible.
Diffstat (limited to 'ares')
-rw-r--r-- | ares/ares.h | 1 | ||||
-rw-r--r-- | ares/ares_init.c | 10 | ||||
-rw-r--r-- | ares/ares_private.h | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/ares/ares.h b/ares/ares.h index e2c7f4c05..0f162e2a1 100644 --- a/ares/ares.h +++ b/ares/ares.h @@ -185,7 +185,6 @@ struct ares_options { int timeout; /* in seconds or milliseconds, depending on options */ int tries; int ndots; - int rotate; unsigned short udp_port; unsigned short tcp_port; int socket_send_buffer_size; diff --git a/ares/ares_init.c b/ares/ares_init.c index 7c355c39e..55c0b93ab 100644 --- a/ares/ares_init.c +++ b/ares/ares_init.c @@ -269,10 +269,14 @@ int ares_save_options(ares_channel channel, struct ares_options *options, if (!ARES_CONFIG_CHECK(channel)) return ARES_ENODATA; + /* Traditionally the optmask wasn't saved in the channel struct so it was + recreated here. ROTATE is the first option that has no struct field of + its own in the public config struct */ (*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS| ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB| ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS| - ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS); + ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS) | + (channel->optmask & ARES_OPT_ROTATE); /* Copy easy stuff */ options->flags = channel->flags; @@ -355,7 +359,7 @@ static int init_by_options(ares_channel channel, if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1) channel->ndots = options->ndots; if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1) - channel->rotate = options->rotate; + channel->rotate = 1; if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1) channel->udp_port = options->udp_port; if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1) @@ -431,6 +435,8 @@ static int init_by_options(ares_channel channel, channel->nsort = options->nsort; } + channel->optmask = optmask; + return ARES_SUCCESS; } diff --git a/ares/ares_private.h b/ares/ares_private.h index a7be3f0ea..bae0b077d 100644 --- a/ares/ares_private.h +++ b/ares/ares_private.h @@ -263,6 +263,8 @@ struct ares_channeldata { int nsort; char *lookups; + int optmask; /* the option bitfield passed in at init time */ + /* Server addresses and communications state */ struct server_state *servers; int nservers; |