summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sesse@google.com>2007-09-28 15:15:39 +0000
committerSteinar H. Gunderson <sesse@google.com>2007-09-28 15:15:39 +0000
commit56ffdcefe1a7e2f60bf451a7d3a16cb903dcf9d9 (patch)
tree69230da18683f08219e68132dfd937784784537f /ares_init.c
parent50ba81cd230f9054fa7c45cb4202ce8720c502b3 (diff)
downloadc-ares-56ffdcefe1a7e2f60bf451a7d3a16cb903dcf9d9.tar.gz
c-ares-56ffdcefe1a7e2f60bf451a7d3a16cb903dcf9d9.tar.bz2
c-ares-56ffdcefe1a7e2f60bf451a7d3a16cb903dcf9d9.zip
Support a few more socket options, and refactor the option setting a bit. (Patch from the Google tree.)
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ares_init.c b/ares_init.c
index 298dd7b..6c36d6e 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -133,6 +133,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
channel->ndots = -1;
channel->udp_port = -1;
channel->tcp_port = -1;
+ channel->socket_send_buffer_size = -1;
+ channel->socket_receive_buffer_size = -1;
channel->nservers = -1;
channel->ndomains = -1;
channel->nsort = -1;
@@ -320,6 +322,12 @@ static int init_by_options(ares_channel channel,
channel->sock_state_cb = options->sock_state_cb;
channel->sock_state_cb_data = options->sock_state_cb_data;
}
+ if ((optmask & ARES_OPT_SOCK_SNDBUF)
+ && channel->socket_send_buffer_size == -1)
+ channel->socket_send_buffer_size = options->socket_send_buffer_size;
+ if ((optmask & ARES_OPT_SOCK_RCVBUF)
+ && channel->socket_receive_buffer_size == -1)
+ channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
/* Copy the servers, if given. */
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)