aboutsummaryrefslogtreecommitdiff
path: root/lib/hostares.c
AgeCommit message (Collapse)Author
2011-01-27ares_query_completed_cb: don't touch invalid dataDaniel Stenberg
When this callback is called due to the destruction of the ares handle, the connection pointer passed in as an argument may no longer pointing to valid data and this function doesn't need to do anything with it anyway so we make sure it doesn't. Bug: http://curl.haxx.se/mail/lib-2011-01/0333.html Reported by: Vsevolod Novikov
2011-01-04Curl_timeleft: s/conn/data in first argumentDaniel Stenberg
As the function doesn't really use the connectdata struct but only the SessionHanadle struct I modified what argument it wants.
2010-12-18ares: ask for both IPv4 and IPv6 addressesTommie Gannert
Make the c-ares resolver code ask for both IPv4 and IPv6 addresses when IPv6 is enabled. This is a workaround for the missing ares_getaddrinfo() and is a lot easier to implement. Note that as long as c-ares returns IPv4 addresses when IPv6 addresses were requested but missing, this will cause a host's IPv4 addresses to occur twice in the DNS cache. URL: http://curl.haxx.se/mail/lib-2010-12/0041.html
2010-12-05Curl_wait_for_resolv: correct timeoutDaniel Stenberg
When looping in this function and checking for the timeout being expired, it was not updating the reference time when calculating the timediff since previous round which made it think each subsequent loop to have taken longer than it actually did. I also modified the function to use the generic Curl_timeleft() function instead of the custom logic. Bug: http://curl.haxx.se/bug/view.cgi?id=3112579
2010-11-11ip_version: moved to connection structDaniel Stenberg
The IP version choice was previously only in the UserDefined struct within the SessionHandle, but since we sometimes alter that option during a request we need to have it on a per-connection basis. I also moved more "init conn" code into the allocate_conn() function which is designed for that purpose more or less.
2010-11-08fix compiler warningYang Tse
2010-05-20Fix build warnings.Ben Greear
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-03-24remove the CVSish $Id$ linesDaniel Stenberg
2010-03-11fix compiler warningYang Tse
2010-01-26- Mike Crowe made libcurl return CURLE_COULDNT_RESOLVE_PROXY when it is theDaniel Stenberg
proxy that cannot be resolved when using c-ares. This matches the behaviour when not using c-ares.
2010-01-25Constantine Sapuntzakis threaded resolver enhancementsYang Tse
2010-01-22Constantine Sapuntzakis refactoring of async callbacks, allowingYang Tse
removal of Curl_addrinfo_copy(), Curl_addrinfo6_callback(), and Curl_addrinfo4_callback()
2010-01-06- Make sure the progress callback is called repeatedly even during very slowDaniel Stenberg
name resolves when c-ares is used for resolving.
2009-12-30VMS specific preprocessor symbol checking adjustmentsYang Tse
2009-09-15Revert Joshua Kwan's patch committed 11 Sep 2009.Yang Tse
Some systems poll function sets POLLHUP in revents without setting POLLIN, and sets POLLERR without setting POLLIN and POLLOUT. In some libcurl code execution paths this could trigger busy wait loops with high CPU usage until a timeout condition aborted the loop. The reverted patch addressed the above issue for a very specific case, when awaiting c-ares to resolve. A libcurl-wide fix superceeds this one. http://cool.haxx.se/cvs.cgi/curl/lib/select.c.diff?r1=1.52&r2=1.53
2009-09-11 Joshua Kwan provided a patch to pass POLLERR / POLLHUP back to c-ares.Gunter Knauf
This fixes a loop problem with high CPU usage.
2009-04-21libcurl's memory.h renamed to curl_memory.hYang Tse
2009-04-21Moved potential inclusion of system's malloc.h and memory.h header files toYang Tse
setup_once.h. Inclusion of each header file is based on the definition of NEED_MALLOC_H and NEED_MEMORY_H respectively.
2009-04-14use HAVE_LIMITS_H symbol to protect limits.h inclusionYang Tse
2009-04-14include <limits.h> for INT_MAX definitionYang Tse
2009-01-31- When building with c-ares 1.6.1 (not yet released) or later and IPv6 supportDaniel Stenberg
enabled, we can now take advantage of its brand new AF_UNSPEC support in ares_gethostbyname(). This makes test case 241 finally run fine for me wtih this setup since it now parses the "::1 ip6-localhost" line fine in my /etc/hosts file!
2008-11-06Merged existing IPv4 and IPv6 Curl_ip2addr functions into a single oneYang Tse
which now also takes a protocol address family argument.
2008-11-01Daniel Johnson reported and fixed ipv4 name resolves when libcurl is builtDaniel Stenberg
with ipv6-enabled c-ares
2008-10-10attempt to fix or allow further detection of an elusive icc SIGSEGVYang Tse
2008-10-10move struct namebuf6 declaration out of Curl_ip2addr6()Yang Tse
2008-09-29Removed unneeded includes of signal.h and setjmp.hDan Fandrich
2008-09-24ntoa() and inet_ntoa_r() no longer usedYang Tse
2008-08-20Use 'Curl_inet_pton()' instead of 'inet_pton()'.Yang Tse
2008-07-09- Andreas Schuldei improved Phil Blundell's patch for IPv6 using c-ares, and IDaniel Stenberg
edited it slightly. Now you should be able to use IPv6 addresses fine even with libcurl built to use c-ares.
2008-04-29improve easy interface resolving timeout handling in c-ares enabled buildsYang Tse
2007-11-07if () => if()Daniel Stenberg
while () => while() and some other minor re-indentings
2007-10-20Fix compiler warning: conversion from "int" to "unsigned short" may lose ↵Yang Tse
significant bits
2007-10-03Fix issue related with the use of ares_timeout() result.Yang Tse
2007-09-27a name resolve that times out is still a failed name resolveDaniel Stenberg
2007-06-11restore the correct timeout time that my previous commit brokeDaniel Stenberg
2007-06-11Properly wait for the c-ares resolve to complete, hopefully the cure forDaniel Stenberg
bug #1733955
2007-05-31When transferring 500 downloads in parallel with a c-ares enabled build onlyDaniel Stenberg
to find that it crashed miserably, and this was due to some select()isms left in the code. This was due to API restrictions in c-ares 1.3.x, but with the upcoming c-ares 1.4.0 this is no longer the case so now libcurl runs much better with c-ares and the multi interface with > 1024 file descriptors in use.
2007-03-27New Internal wrapper function Curl_select() around select (2), itYang Tse
uses poll() when a fine poll() is available, so now libcurl can be built without select() support at all if a fine poll() is available.
2007-02-26Removed inclusion of <sys/types.h> and <sys/stat.h> in .c-filesGisle Vanem
since they're already included through "setup.h".
2007-02-16use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handlingYang Tse
2007-02-05- Michael Wallner provided a patch that adds support for CURLOPT_TIMEOUT_MSDaniel Stenberg
and CURLOPT_CONNECTTIMEOUT_MS that, as their names should hint, do the timeouts with millisecond resolution instead. The only restriction to that is the alarm() (sometimes) used to abort name resolves as that uses full seconds. I fixed the FTP response timeout part of the patch. Internally we now count and keep the timeouts in milliseconds but it also means we multiply set timeouts with 1000. The effect of this is that no timeout can be set to more than 2^31 milliseconds (on 32 bit systems), which equals 24.86 days. We probably couldn't before either since the code did *1000 on the timeout values on several places already.
2006-10-17Jeff helped me pinpoint that we didn't properly set the expire timer duringDaniel Stenberg
c-ares name resolves, but now we do!
2006-07-25Simplify check for NEED_MALLOC_H, and make more explicit that NEED_MALLOC_H ↵Yang Tse
shall be defined if <malloc.h> header file must be included even when including <stdlib.h>.
2006-07-25Moved functions common to IPv4 and C-ares to hostip.c;Gisle Vanem
Curl_freeaddrinfo() and Curl_ip2addr().
2006-07-24Use the proper Curl_freeaddrinfo() for CURLRES_ARES.Gisle Vanem
2006-07-21Constify 'hostname' and 'service' to various resolver functions.Gisle Vanem
2006-07-21Changes for combination ENABLE_IPV6 and USE_ARES.Gisle Vanem
2006-07-11include <malloc.h> only if HAVE_MALLOC_H and NEED_MALLOC_H are both defined.Yang Tse
2006-05-05get the Curl_sockerrno protoDaniel Stenberg
2006-05-04Roland Blom filed bug report #1481217Daniel Stenberg
(http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele Bini and David Byron. libcurl previously wrongly used GetLastError() on windows to get error details after socket-related function calls, when it really should use WSAGetLastError() instead. When changing to this, the former function Curl_ourerrno() is now instead called Curl_sockerrno() as it is necessary to only use it to get errno from socket-related functions as otherwise it won't work as intended on Windows.