summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorhpopescu@ixiacom.com <hpopescu@ixiacom.com>2012-08-10 12:06:09 +0300
committerDaniel Stenberg <daniel@haxx.se>2012-08-17 00:54:47 +0200
commit90364defb038d5d6b97acf9df9ed152d2393a863 (patch)
tree82ea71d7a7718652727fed628849a247c464728b /ares_init.c
parente447bc5c603a139852fd74d9930c1293535ea749 (diff)
downloadc-ares-90364defb038d5d6b97acf9df9ed152d2393a863.tar.gz
c-ares-90364defb038d5d6b97acf9df9ed152d2393a863.tar.bz2
c-ares-90364defb038d5d6b97acf9df9ed152d2393a863.zip
Added new feature (rfc2671)
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ares_init.c b/ares_init.c
index f9eb054..a94a917 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -163,6 +163,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
channel->rotate = -1;
channel->udp_port = -1;
channel->tcp_port = -1;
+ channel->ednspsz = -1;
channel->socket_send_buffer_size = -1;
channel->socket_receive_buffer_size = -1;
channel->nservers = -1;
@@ -453,6 +454,9 @@ static int init_by_options(ares_channel channel,
&& channel->socket_receive_buffer_size == -1)
channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
+ if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1)
+ channel->ednspsz = options->ednspsz;
+
/* Copy the IPv4 servers, if given. */
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
{
@@ -1358,6 +1362,9 @@ static int init_by_defaults(ares_channel channel)
if (channel->tcp_port == -1)
channel->tcp_port = htons(NAMESERVER_PORT);
+ if (channel->ednspsz == -1)
+ channel->ednspsz = EDNSPACKETSZ;
+
if (channel->nservers == -1) {
/* If nobody specified servers, try a local named. */
channel->servers = malloc(sizeof(struct server_state));