summaryrefslogtreecommitdiff
path: root/lib/hostip.h
Commit message (Collapse)AuthorAgeFilesLines
* socks: make the connect phase non-blockingDaniel Stenberg2020-02-171-12/+15
| | | | | | Removes two entries from KNOWN_BUGS. Closes #4907
* global_init: move the IPv6 works status bool to multi handleDaniel Stenberg2020-01-281-3/+3
| | | | | | | | | Previously it was stored in a global state which contributed to curl_global_init's thread unsafety. This boolean is now instead figured out in curl_multi_init() and stored in the multi handle. Less effective, but thread safe. Closes #4851
* timediff: make it 64 bit (if possible) even with 32 bit time_tDaniel Stenberg2019-08-011-1/+2
| | | | | | | ... to make it hold microseconds too. Fixes #4165 Closes #4168
* cleanup: remove the 'numsocks' argument used in many placesDaniel Stenberg2019-07-301-2/+1
| | | | | | | | | It was used (intended) to pass in the size of the 'socks' array that is also passed to these functions, but was rarely actually checked/used and the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries that should be used instead. Closes #4169
* headers: Remove no longer exported functionsDaniel Gustafsson2019-07-101-9/+0
| | | | | | | | | | | | | | | | | | | | There were a leftover few prototypes of Curl_ functions that we used to export but no longer do, this removes those prototypes and cleans up any comments still referring to them. Curl_write32_le(), Curl_strcpy_url(), Curl_strlen_url(), Curl_up_free() Curl_concat_url(), Curl_detach_connnection(), Curl_http_setup_conn() were made static in 05b100aee247bb9bec8e9a1b0166496aa4248d1c. Curl_http_perhapsrewind() made static in 574aecee208f79d391f10d57520b3. For the remainder, I didn't trawl the Git logs hard enough to capture their exact time of deletion, but they were all gone: Curl_splayprint(), Curl_http2_send_request(), Curl_global_host_cache_dtor(), Curl_scan_cache_used(), Curl_hostcache_destroy(), Curl_second_connect(), Curl_http_auth_stage() and Curl_close_connections(). Closes #4096 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* doh: disable DOH for the cases it doesn't workDaniel Stenberg2019-05-111-2/+5
| | | | | | | | | | Due to limitations in Curl_resolver_wait_resolv(), it doesn't work for DOH resolves. This fix disables DOH for those. Limitation added to KNOWN_BUGS. Fixes #3850 Closes #3857
* cleanup: make local functions staticDaniel Stenberg2019-02-101-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urlapi: turn three local-only functions into statics conncache: make conncache_find_first_connection static multi: make detach_connnection static connect: make getaddressinfo static curl_ntlm_core: make hmac_md5 static http2: make two functions static http: make http_setup_conn static connect: make tcpnodelay static tests: make UNITTEST a thing to mark functions with, so they can be static for normal builds and non-static for unit test builds ... and mark Curl_shuffle_addr accordingly. url: make up_free static setopt: make vsetopt static curl_endian: make write32_le static rtsp: make rtsp_connisdead static warnless: remove unused functions memdebug: remove one unused function, made another static
* setopt: add CURLOPT_DOH_URLDaniel Stenberg2018-09-061-6/+7
| | | | Closes #2668
* resolve: add CURLOPT_DNS_SHUFFLE_ADDRESSESRick Deist2018-03-171-1/+12
| | | | | | | | | | | This patch adds CURLOPT_DNS_SHUFFLE_ADDRESSES to explicitly request shuffling of IP addresses returned for a hostname when there is more than one. This is useful when the application knows that a round robin approach is appropriate and is willing to accept the consequences of potentially discarding some preference order returned by the system's implementation. Closes #1694
* spelling fixesklemens2017-03-261-2/+2
| | | | Closes #1356
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-1/+1
| | | | In order to make the code style more uniform everywhere
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-2/+2
|
* lib: fix compiler warnings after de4de4e3c7cMarcel Raad2016-11-181-1/+1
| | | | | | | | | Visual C++ now complains about implicitly casting time_t (64-bit) to long (32-bit). Fix this by changing some variables from long to time_t, or explicitly casting to long where the public interface would be affected. Closes #1131
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-11/+11
|
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* hostcache: made all host caches use structs, not pointersDaniel Stenberg2015-05-121-2/+2
| | | | | | This avoids unnecessary dynamic allocs and as this also removed the last users of *hash_alloc() and *hash_destroy(), those two functions are now removed.
* move Curl_share_lock and ref counting into Curl_fetch_addrStefan Bühler2015-04-031-0/+3
|
* fix refreshing of obsolete dns cache entriesStefan Bühler2015-04-031-4/+3
| | | | | | | | | | | | - cache entries must be also refreshed when they are in use - have the cache count as inuse reference too, freeing timestamp == 0 special value - use timestamp == 0 for CURLOPT_RESOLVE entries which don't get refreshed - remove CURLOPT_RESOLVE special inuse reference (timestamp == 0 will prevent refresh) - fix Curl_hostcache_clean - CURLOPT_RESOLVE entries don't have a special reference anymore, and it would also release non CURLOPT_RESOLVE references - fix locking in Curl_hostcache_clean - fix unit1305.c: hash now keeps a reference, need to set inuse = 1
* hostip: remove 'stale' argument from Curl_fetch_addr protoDaniel Stenberg2015-01-071-4/+2
| | | | | Also, remove the log output of the resolved name is NOT in the cache in the spirit of only telling when something is actually happening.
* code/docs: Use correct case for IPv4 and IPv6Steve Holme2014-12-271-2/+2
| | | | | | For consistency, as we seem to have a bit of a mixed bag, changed all instances of ipv4 and ipv6 in comments and documentations to use the correct case.
* resolve: cache lookup for async resolversMichael Wallner2014-08-311-0/+11
| | | | | | | | | | While waiting for a host resolve, check if the host cache may have gotten the name already (by someone else), for when the same name is resolved by several simultanoues requests. The resolver thread occasionally gets stuck in getaddrinfo() when the DNS or anything else is crappy or slow, so when a host is found in the DNS cache, leave the thread alone and let itself cleanup the mess.
* dns: fix compilation with MinGW from commit df69440d05f113Steve Holme2013-09-171-1/+1
| | | | | | Avoid 'interface' literal that some MinGW versions define as a macro Additionally, corrected some very, very minor coding style errors.
* libcurl: New options to bind DNS to local interfaces or IP addressesKim Vandry2013-09-121-0/+21
|
* global dns cache: didn't work [regression]Daniel Stenberg2013-08-081-2/+2
| | | | | | | | | CURLOPT_DNS_USE_GLOBAL_CACHE broke in commit c43127414d89ccb (been broken since the libcurl 7.29.0 release). While this option has been documented as deprecated for almost a decade and nobody even reported this bug, it should remain functional. Added test case 1512 to verify
* build: fix circular header inclusion with other packagesYang Tse2013-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit renames lib/setup.h to lib/curl_setup.h and renames lib/setup_once.h to lib/curl_setup_once.h. Removes the need and usage of a header inclusion guard foreign to libcurl. [1] Removes the need and presence of an alarming notice we carried in old setup_once.h [2] ---------------------------------------- 1 - lib/setup_once.h used __SETUP_ONCE_H macro as header inclusion guard up to commit ec691ca3 which changed this to HEADER_CURL_SETUP_ONCE_H, this single inclusion guard is enough to ensure that inclusion of lib/setup_once.h done from lib/setup.h is only done once. Additionally lib/setup.h has always used __SETUP_ONCE_H macro to protect inclusion of setup_once.h even after commit ec691ca3, this was to avoid a circular header inclusion triggered when building a c-ares enabled version with c-ares sources available which also has a setup_once.h header. Commit ec691ca3 exposes the real nature of __SETUP_ONCE_H usage in lib/setup.h, it is a header inclusion guard foreign to libcurl belonging to c-ares's setup_once.h The renaming this commit does, fixes the circular header inclusion, and as such removes the need and usage of a header inclusion guard foreign to libcurl. Macro __SETUP_ONCE_H no longer used in libcurl. 2 - Due to the circular interdependency of old lib/setup_once.h and the c-ares setup_once.h header, old file lib/setup_once.h has carried back from 2006 up to now days an alarming and prominent notice about the need of keeping libcurl's and c-ares's setup_once.h in sync. Given that this commit fixes the circular interdependency, the need and presence of mentioned notice is removed. All mentioned interdependencies come back from now old days when the c-ares project lived inside a curl subdirectory. This commit removes last traces of such fact.
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-0/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: rename 76 lib/*.h filesYang Tse2012-12-281-218/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 76 private header files renamed to use our standard naming scheme. This commit only does the file renaming. ---------------------------------------- renamed: amigaos.h -> curl_amigaos.h renamed: arpa_telnet.h -> curl_arpa_telnet.h renamed: asyn.h -> curl_asyn.h renamed: axtls.h -> curl_axtls.h renamed: bundles.h -> curl_bundles.h renamed: conncache.h -> curl_conncache.h renamed: connect.h -> curl_connect.h renamed: content_encoding.h -> curl_content_encoding.h renamed: cookie.h -> curl_cookie.h renamed: cyassl.h -> curl_cyassl.h renamed: dict.h -> curl_dict.h renamed: easyif.h -> curl_easyif.h renamed: escape.h -> curl_escape.h renamed: file.h -> curl_file.h renamed: fileinfo.h -> curl_fileinfo.h renamed: formdata.h -> curl_formdata.h renamed: ftp.h -> curl_ftp.h renamed: ftplistparser.h -> curl_ftplistparser.h renamed: getinfo.h -> curl_getinfo.h renamed: gopher.h -> curl_gopher.h renamed: gtls.h -> curl_gtls.h renamed: hash.h -> curl_hash.h renamed: hostcheck.h -> curl_hostcheck.h renamed: hostip.h -> curl_hostip.h renamed: http.h -> curl_http.h renamed: http_chunks.h -> curl_http_chunks.h renamed: http_digest.h -> curl_http_digest.h renamed: http_negotiate.h -> curl_http_negotiate.h renamed: http_proxy.h -> curl_http_proxy.h renamed: if2ip.h -> curl_if2ip.h renamed: imap.h -> curl_imap.h renamed: inet_ntop.h -> curl_inet_ntop.h renamed: inet_pton.h -> curl_inet_pton.h renamed: krb4.h -> curl_krb4.h renamed: llist.h -> curl_llist.h renamed: memdebug.h -> curl_memdebug.h renamed: multiif.h -> curl_multiif.h renamed: netrc.h -> curl_netrc.h renamed: non-ascii.h -> curl_non-ascii.h renamed: nonblock.h -> curl_nonblock.h renamed: nssg.h -> curl_nssg.h renamed: parsedate.h -> curl_parsedate.h renamed: pingpong.h -> curl_pingpong.h renamed: polarssl.h -> curl_polarssl.h renamed: pop3.h -> curl_pop3.h renamed: progress.h -> curl_progress.h renamed: qssl.h -> curl_qssl.h renamed: rawstr.h -> curl_rawstr.h renamed: rtsp.h -> curl_rtsp.h renamed: select.h -> curl_select.h renamed: sendf.h -> curl_sendf.h renamed: setup.h -> curl_setup.h renamed: setup_once.h -> curl_setup_once.h renamed: share.h -> curl_share.h renamed: slist.h -> curl_slist.h renamed: smtp.h -> curl_smtp.h renamed: sockaddr.h -> curl_sockaddr.h renamed: socks.h -> curl_socks.h renamed: speedcheck.h -> curl_speedcheck.h renamed: splay.h -> curl_splay.h renamed: ssh.h -> curl_ssh.h renamed: sslgen.h -> curl_sslgen.h renamed: ssluse.h -> curl_ssluse.h renamed: strdup.h -> curl_strdup.h renamed: strequal.h -> curl_strequal.h renamed: strerror.h -> curl_strerror.h renamed: strtok.h -> curl_strtok.h renamed: strtoofft.h -> curl_strtoofft.h renamed: telnet.h -> curl_telnet.h renamed: tftp.h -> curl_tftp.h renamed: timeval.h -> curl_timeval.h renamed: transfer.h -> curl_transfer.h renamed: url.h -> curl_url.h renamed: urldata.h -> curl_urldata.h renamed: warnless.h -> curl_warnless.h renamed: wildcard.h -> curl_wildcard.h ----------------------------------------
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-3/+3
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* fixed memory leak: CURLOPT_RESOLVE with multi interfaceDaniel Stenberg2012-11-181-1/+9
| | | | | | | | | | DNS cache entries populated with CURLOPT_RESOLVE were not properly freed again when done using the multi interface. Test case 1502 added to verify. Bug: http://curl.haxx.se/bug/view.cgi?id=3575448 Reported by: Alex Gruz
* CURLOPT_RESOLVE: avoid adding already present host namesDaniel Stenberg2011-12-311-0/+2
| | | | | | | The load host names to DNS cache function was moved to hostip.c and it now makes sure to not add host names that already are present in the cache. It would previously lead to memory leaks when for example using the --resolve and multiple URLs on the command line.
* resolve: don't leak pre-populated dns entriesDaniel Stenberg2011-12-231-0/+5
| | | | | | | | | CURLOPT_RESOLVE populates the DNS cache with entries that are marked as eternally in use. Those entries need to be taken care of when the cache is killed off. Bug: http://curl.haxx.se/bug/view.cgi?id=3463121 Reported by: "tw84452852"
* CURLOPT_DNS_SERVERS: set name servers if possibleJason Glasgow2011-11-171-0/+5
|
* Fixed compilation when the synchronous resolver is usedDan Fandrich2011-04-251-1/+8
|
* async resolvers: further cleanupsDaniel Stenberg2011-04-251-69/+1
| | | | | | | | asyn-ares.c and asyn-thread.c are two separate backends that implement the same (internal) async resolver API for libcurl to use. Backend is specified at build time. The internal resolver API is defined in asyn.h for asynch resolvers.
* asynch resolvers: cleanupDaniel Stenberg2011-04-251-16/+24
| | | | | | | | Fixed indents, coding conventions and white space edits. Modified the c-ares completion callback function to again NOT read the conn data when the ares handle is being taken down as then it may have been freed already.
* asynch resolvers: unifiedVsevolod Novikov2011-04-251-31/+48
| | | | | Introducing an internal API for handling of different async resolver backends.
* Fix a couple of spelling errors in lib/Fabian Keil2011-04-211-1/+1
| | | | Found with codespell.
* ipv6: only probe onceDaniel Stenberg2011-03-231-1/+10
| | | | | | | | | Move ipv6-functional-probe into a single function that is used from all places that need to know. Make the probe function store the result in a static variable so that subsequent invokes just returns the previous result and won't have to probe again.
* c-ares: fix cancelled resolvesDaniel Stenberg2010-12-271-0/+6
| | | | | | | | | | | | | | When built IPv6-enabled, we could do Curl_done() with one of the two resolves having returned already, so when ares_cancel() is called the resolve callback ends up doing funny things (sometimes resulting in a segfault) since it would try to actually store the previous resolve even though we're shutting down the resolve. This bug was introduced in commit 8ab137b2bc9630ce so it hasn't been included in any public release. Bug: http://curl.haxx.se/bug/view.cgi?id=3145445 Reported by: Pedro Larroy
* ip_version: moved to connection structDaniel Stenberg2010-11-111-1/+1
| | | | | | | | | 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.
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* Constantine Sapuntzakis threaded resolver enhancementsYang Tse2010-01-251-3/+6
|
* Definitions of resolver specialty compile-time defines CURLRES_* movedYang Tse2010-01-221-26/+1
| | | | | | | | from hostip.h to setup.h in order to allow proper inclusion in any file. This represents no functional change at all in which resolver is used, everything still works as usual, internally and externally there is no difference in behavior.
* Constantine Sapuntzakis refactoring of async callbacks, allowingYang Tse2010-01-221-34/+10
| | | | | removal of Curl_addrinfo_copy(), Curl_addrinfo6_callback(), and Curl_addrinfo4_callback()
* - Constantine Sapuntzakis posted bug #2891595Daniel Stenberg2009-11-111-0/+2
| | | | | | | (http://curl.haxx.se/bug/view.cgi?id=2891595) which identified how an entry in the DNS cache would linger too long if the request that added it was in use that long. He also provided the patch that now makes libcurl capable of still doing a request while the DNS hash entry may get timed out.
* Merged existing IPv4 and IPv6 Curl_ip2addr functions into a single oneYang Tse2008-11-061-9/+0
| | | | which now also takes a protocol address family argument.
* Move curl_dofreeaddrinfo() and curl_dofreeaddrinfo()Yang Tse2008-10-301-9/+1
| | | | | implementation from lib/hostip6.c to lib/curl_addrinfo.c and prototypes from lib/hostip.h to lib/curl_addrinfo.h
* Use our Curl_addrinfo definition even when an addrinfo struct is available.Yang Tse2008-10-301-30/+4
| | | | Use a wrapper function to call system's getaddrinfo().
* take 2 at fixing compiler warning: argument might be clobbered by `longjmp' ↵Yang Tse2008-10-021-1/+1
| | | | or `vfork'
* fix compiler warning: `variable' might be clobbered by `longjmp' or `vfork'Yang Tse2008-10-021-1/+1
|