summaryrefslogtreecommitdiff
path: root/ares_send.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_send.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_send.c')
-rw-r--r--ares_send.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ares_send.c b/ares_send.c
index 75a84f6..d3f734f 100644
--- a/ares_send.c
+++ b/ares_send.c
@@ -42,7 +42,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
ares_callback callback, void *arg)
{
struct query *query;
- int i;
+ int i, packetsz;
struct timeval now;
/* Verify that the query is at least long enough to hold the header. */
@@ -109,7 +109,10 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
query->server_info[i].skip_server = 0;
query->server_info[i].tcp_connection_generation = 0;
}
- query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > PACKETSZ;
+
+ packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
+ query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
+
query->error_status = ARES_ECONNREFUSED;
query->timeouts = 0;