summaryrefslogtreecommitdiff
path: root/lib/curl_addrinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* windows: enable UnixSockets with all build toolchainsViktor Szakats2020-04-041-5/+1
| | | | | | | | | | | Extend existing unix socket support in Windows builds to be enabled for all toolchain vendors or versions. (Previously it was only supported with certain MSVC versions + more recent Windows 10 SDKs) Ref: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ Ref: https://github.com/curl/curl/issues/5162 Closes: https://github.com/curl/curl/pull/5170
* memdebug: log pointer before freeing its dataDaniel Stenberg2019-03-121-2/+2
| | | | | | | | | | | | Coverity warned for two potentional "Use after free" cases. Both are false positives because the memory wasn't used, it was only the actual pointer value that was logged. The fix still changes the order of execution to avoid the warnings. Coverity CID 1443033 and 1443034 Closes #3671
* memdebug: make debug-specific functions use curl_dbg_ prefixDaniel Stenberg2019-03-081-16/+16
| | | | | | | To not "collide" or use up the regular curl_ name space. Also makes them easier to detect in helper scripts. Closes #3656
* curl_addrinfo: use same #ifdef conditions in source as headerDaniel Stenberg2018-06-011-1/+2
| | | | ... for curl_dofreeaddrinfo
* curl_setup: provide a CURL_SA_FAMILY_T type if none existsDaniel Stenberg2018-04-071-2/+2
| | | | | | | ... and use this type instead of 'sa_family_t' in the code since several platforms don't have it. Closes #2463
* build: add picky compiler warning flags for gcc 6 and 7Eric Gallager2018-04-071-2/+2
|
* curl_addrinfo.c: Allow Unix Domain Sockets to compile under WindowsSteve Holme2018-02-071-1/+5
| | | | | | | | | Windows 10.0.17061 SDK introduces support for Unix Domain Sockets. Added the necessary include file to curl_addrinfo.c. Note: The SDK (which is considered beta) has to be installed, VS 2017 project file has to be re-targeted for Windows 10.0.17061 and #define enabled in config-win32.h.
* configure: check for netinet/in6.hRandall S. Becker2017-12-061-0/+3
| | | | | | | Needed by HPE NonStop NSE and NSX systems Fixes #2146 Closes #2155
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-3/+3
|
* Improve code readbilitySylvestre Ledru2017-03-131-1/+1
| | | | | | ... by removing the else branch after a return, break or continue. Closes #1310
* addrinfo: fix compiler warning on offsetof() useDaniel Stenberg2017-01-141-2/+3
| | | | | | | | curl_addrinfo.c:519:20: error: conversion to ‘curl_socklen_t {aka unsigned int}’ from ‘long unsigned int’ may alter its value [-Werror=conversion] Follow-up to 1d786faee1046f
* unix_socket: add support for abstract unix domain socketIsaac Boukris2017-01-131-8/+19
| | | | | | | | | | | | | | | | | | | | | In addition to unix domain sockets, Linux also supports an abstract namespace which is independent of the filesystem. In order to support it, add new CURLOPT_ABSTRACT_UNIX_SOCKET option which uses the same storage as CURLOPT_UNIX_SOCKET_PATH internally, along with a flag to specify abstract socket. On non-supporting platforms, the abstract address will be interpreted as an empty string and fail gracefully. Also add new --abstract-unix-socket tool parameter. Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reported-by: Chungtsun Li (typeless) Reviewed-by: Daniel Stenberg Reviewed-by: Peter Wu Closes #1197 Fixes #1061
* checksrc: warn for assignments within if() expressionsDaniel Stenberg2016-12-141-8/+18
| | | | | ... they're already frowned upon in our source code style guide, this now enforces the rule harder.
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-4/+4
| | | | In order to make the code style more uniform everywhere
* resolve: add support for IPv6 DNS64/NAT64 Networks on OS X + iOSLuo Jinghua2016-06-071-0/+29
| | | | | | | | | Use getaddrinfo() to resolve the IPv4 address literal on iOS/Mac OS X. If the current network interface doesn’t support IPv4, but supports IPv6, NAT64, and DNS64. Closes #866 Fixes #863
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-3/+2
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* lwip: Fix compatibility issues with later versionsGisle Vanem2015-12-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | The name of the header guard in lwIP's <lwip/opt.h> has changed from '__LWIP_OPT_H__' to 'LWIP_HDR_OPT_H' (bug #35874 in May 2015). Other fixes: - In curl_setup.h, the problem with an old PSDK doesn't apply if lwIP is used. - In memdebug.h, the 'socket' should be undefined first due to lwIP's lwip_socket() macro. - In curl_addrinfo.c lwIP's getaddrinfo() + freeaddrinfo() macros need special handling because they were undef'ed in memdebug.h. - In select.c we can't use preprocessor conditionals inside select if MSVC and select is a macro, as it is with lwIP. http://curl.haxx.se/mail/lib-2015-12/0023.html http://curl.haxx.se/mail/lib-2015-12/0024.html
* Bug #149: Deletion of unnecessary checks before calls of the function "free"Markus Elfring2015-03-161-7/+2
| | | | | | | | | | | The function "free" is documented in the way that no action shall occur for a passed null pointer. It is therefore not needed that a function caller repeats a corresponding check. http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first This issue was fixed by using the software Coccinelle 1.0.0-rc24. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
* mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg2015-03-031-5/+2
| | | | | ... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
* code/docs: Use Unix rather than UNIX to avoid use of the trademarkSteve Holme2014-12-261-1/+1
| | | | | Use Unix when generically writing about Unix based systems as UNIX is the trademark and should only be used in a particular product's name.
* Curl_unix2addr: avoid using the variable name 'sun'Daniel Stenberg2014-12-101-5/+5
| | | | | | I suspect this causes compile failures on Solaris: Bug: http://curl.haxx.se/mail/lib-2014-12/0081.html
* libcurl: add UNIX domain sockets supportPeter Wu2014-12-041-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ability to do HTTP requests over a UNIX domain socket has been requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a discussion happened, no patch seems to get through. I decided to give it a go since I need to test a nginx HTTP server which listens on a UNIX domain socket. One patch [3] seems to make it possible to use the CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket. Another person wrote a Go program which can do HTTP over a UNIX socket for Docker[4] which uses a special URL scheme (though the name contains cURL, it has no relation to the cURL library). This patch considers support for UNIX domain sockets at the same level as HTTP proxies / IPv6, it acts as an intermediate socket provider and not as a separate protocol. Since this feature affects network operations, a new feature flag was added ("unix-sockets") with a corresponding CURL_VERSION_UNIX_SOCKETS macro. A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This option enables UNIX domain sockets support for all requests on the handle (replacing IP sockets and skipping proxies). A new configure option (--enable-unix-sockets) and CMake option (ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I deliberately did not mark this feature as advanced, this is a feature/component that should easily be available. [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/ [2]: http://sourceforge.net/p/curl/feature-requests/53/ [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html [4]: https://github.com/Soulou/curl-unix-socket Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* code cleanup: we prefer 'CURLcode result'Daniel Stenberg2014-10-241-2/+2
| | | | | | | | | | | | | | ... for the local variable name in functions holding the return code. Using the same name universally makes code easier to read and follow. Also, unify code for checking for CURLcode errors with: if(result) or if(!result) instead of if(result == CURLE_OK), if(CURLE_OK == result) or if(result != CURLE_OK)
* 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-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: make use of 93 lib/*.c renamed filesYang Tse2013-01-031-5/+5
| | | | | | 93 *.c source files renamed to use our standard naming scheme. This change affects 77 files in libcurl's source tree.
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-4/+4
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>Yang Tse2012-12-141-4/+1
| | | | Inclusion of top two most included header files now done in setup_once.h
* stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.hYang Tse2011-07-261-1/+0
|
* compiler warning: fixYang Tse2011-05-261-0/+1
| | | | Fix compiler warning: conversion may lose significant bits
* source cleanup: unify look, style and indent levelsDaniel Stenberg2011-04-271-2/+2
| | | | | By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
* In lib/, change 'wanna' to 'want to'.Fabian Keil2011-04-211-2/+2
| | | | Found with codespell.
* Curl_getaddrinfo_ex: sanitize function results follow-up.Yang Tse2010-11-241-0/+12
|
* Curl_getaddrinfo_ex: sanitize function results.Yang Tse2010-11-231-19/+31
| | | | | | | | Ensure that spurious results from system's getaddrinfo() ares not propagated by Curl_getaddrinfo_ex() into the library. Also ensure that the ai_addrlen member of Curl_getaddrinfo_ex()'s output linked list of Curl_addrinfo structures has appropriate family-specific address size.
* CURLOPT_RESOLVE: addedDaniel Stenberg2010-11-081-0/+21
| | | | | | | | | | | | CURLOPT_RESOLVE is a new option that sends along a curl_slist with name:port:address sets that will populate the DNS cache with entries so that request can be "fooled" to use another host than what otherwise would've been used. Previously we've encouraged the use of Host: for that when dealing with HTTP, but this new feature has the added bonus that it allows the name from the URL to be used for TLS SNI and server certificate name checks as well. This is a first change. Surely more will follow to make it decent.
* warning: silence a win64 compiler warningDaniel Stenberg2010-07-301-1/+4
| | | | | | conversion from 'size_t' to 'curl_socklen_t', possible loss of data Reported by: Adam Light
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* Constantine Sapuntzakis enhancements to make memory tracking log file writingYang Tse2010-01-181-14/+9
| | | | of messages atomic, on systems where an fwrite of a memory buffer is atomic.
* VMS specific preprocessor symbol checking adjustmentsYang Tse2009-12-301-3/+3
|
* Fix type castYang Tse2009-05-101-1/+1
|
* Use build-time configured curl_socklen_t instead of socklen_tYang Tse2009-05-021-1/+1
|
* Further narrow the use of the icc 9.1 optimizer workaround.Yang Tse2009-04-251-1/+1
| | | | Previous workaround proved useful, and finally did not trigger any warning!
* Try a simpler variation of the 'volatile' variables icc 9.1 on unix IA32 ↵Yang Tse2009-04-241-6/+8
| | | | | | | | workaround. Previous workaround proved useful, but triggered the following warning: warning #556: a value of type "volatile Curl_addrinfo *" cannot be assigned to an entity of type "Curl_addrinfo *"
* Try another variation of the 'volatile' variables icc 9.1 on unix IA32 ↵Yang Tse2009-04-231-9/+7
| | | | | | workaround. The #pragma optimize("", off) attempt did not fix the problem and SIGSEGV's in Curl_freeaddrinfo() were back.
* Disable optimizations when compiling function Curl_freeaddrinfo() with icc ↵Yang Tse2009-04-221-7/+9
| | | | | | | | 9.1 on unix IA32. Previous 'volatile' variables workaround proved useful, but it triggered the following warning: warning #167: argument of type "volatile Curl_addrinfo *" is incompatible with parameter of type "void *"
* libcurl's memory.h renamed to curl_memory.hYang Tse2009-04-211-1/+1
|
* Moved potential inclusion of system's malloc.h and memory.h header files toYang Tse2009-04-211-3/+0
| | | | | setup_once.h. Inclusion of each header file is based on the definition of NEED_MALLOC_H and NEED_MEMORY_H respectively.
* further narrow the use of the icc 9.1 optimizer workaroundYang Tse2009-04-171-1/+3
|
* attempt to workaround icc 9.1 optimizer induced problemYang Tse2009-04-161-0/+5
|