1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

- Peter Sylvester made a debug featuer for Curl_resolv() that now will force

libcurl to resolve 'localhost' whatever name you use in the URL *if* you set
  the --interface option to (exactly) "LocalHost". This will enable us to
  write tests for custom hosts names but still use a local host server.
This commit is contained in:
Daniel Stenberg 2009-09-01 14:27:01 +00:00
parent ddb1fb7535
commit 7e07da977c
3 changed files with 21 additions and 6 deletions

View File

@ -7,6 +7,11 @@
Changelog Changelog
Daniel Stenberg (1 Sep 2009) Daniel Stenberg (1 Sep 2009)
- Peter Sylvester made a debug featuer for Curl_resolv() that now will force
libcurl to resolve 'localhost' whatever name you use in the URL *if* you set
the --interface option to (exactly) "LocalHost". This will enable us to
write tests for custom hosts names but still use a local host server.
- configure now tries to use pkg-config for a number of sub-dependencies even - configure now tries to use pkg-config for a number of sub-dependencies even
when cross-compiling. The key to success is then you properly setup when cross-compiling. The key to success is then you properly setup
PKG_CONFIG_PATH before invoking configure. PKG_CONFIG_PATH before invoking configure.

View File

@ -36,6 +36,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Karl Moerder, Kamil Dudka, Krister Johansen, Andre Guibert de Bruet, Karl Moerder, Kamil Dudka, Krister Johansen, Andre Guibert de Bruet,
Michal Marek, Eric Wong, Guenter Knauf Michal Marek, Eric Wong, Guenter Knauf, Peter Sylvester
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -391,6 +391,10 @@ Curl_cache_addr(struct SessionHandle *data,
* function is used. You MUST call Curl_resolv_unlock() later (when you're * function is used. You MUST call Curl_resolv_unlock() later (when you're
* done using this struct) to decrease the counter again. * done using this struct) to decrease the counter again.
* *
* In debug mode, we specifically test for an interface name "LocalHost"
* and resolve "localhost" instead as a means to permit test cases
* to connect to a local test server with any host name.
*
* Return codes: * Return codes:
* *
* CURLRESOLV_ERROR (-1) = error, no pointer * CURLRESOLV_ERROR (-1) = error, no pointer
@ -455,7 +459,13 @@ int Curl_resolv(struct connectdata *conn,
/* If Curl_getaddrinfo() returns NULL, 'respwait' might be set to a /* If Curl_getaddrinfo() returns NULL, 'respwait' might be set to a
non-zero value indicating that we need to wait for the response to the non-zero value indicating that we need to wait for the response to the
resolve call */ resolve call */
addr = Curl_getaddrinfo(conn, hostname, port, &respwait); addr = Curl_getaddrinfo(conn,
#ifdef DEBUGBUILD
(data->set.str[STRING_DEVICE]
&& !strcmp(data->set.str[STRING_DEVICE],
"LocalHost"))?"localhost":
#endif
hostname, port, &respwait);
if(!addr) { if(!addr) {
if(respwait) { if(respwait) {