Commit 930a45e7 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

- Added CURLINFO_PRIMARY_IP as a new information retrievable with

  curl_easy_getinfo. It returns a pointer to a string with the most recently
  used IP address. Modified test case 500 to also verify this feature. The
  implementing of this feature was sponsored by Lenny Rachitsky at NeuStar.
parent afc66554
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7,6 +7,12 @@
                                  Changelog


Daniel Stenberg (6 Jun 2008)
- Added CURLINFO_PRIMARY_IP as a new information retrievable with
  curl_easy_getinfo. It returns a pointer to a string with the most recently
  used IP address. Modified test case 500 to also verify this feature. The
  implementing of this feature was sponsored by Lenny Rachitsky at NeuStar.

Version 7.18.2 (4 June 2008)

Daniel Fandrich (3 Jun 2008)
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Curl and libcurl 7.18.3

This release includes the following changes:
 
 o 
 o Added CURLINFO_PRIMARY_IP

This release includes the following bugfixes:

@@ -31,6 +31,6 @@ New curl mirrors:
This release would not have looked like this without help, code, reports and
advice from friends like these:


 Lenny Rachitsky

        Thanks! (and sorry if I forgot to mention someone)
+6 −0
Original line number Diff line number Diff line
@@ -159,6 +159,12 @@ counted). Combined with \fICURLINFO_REDIRECT_COUNT\fP you are able to know
how many times libcurl successfully reused existing connection(s) or not.  See
the Connection Options of \fIcurl_easy_setopt(3)\fP to see how libcurl tries
to make persistent connections to save time.  (Added in 7.12.3)
.IP CURLINFO_PRIMARY_IP
Pass a pointer to a char pointer to receive the pointer to a zero-terminated
string holding the IP address of the most recent connection done with this
\fBcurl\fP handle. This string may be IPv6 if that's enabled. Note that you
get a pointer to a memory area that will be re-used at next request so you
need to copy the string if you want to keep the information. (Added in 7.18.3)
.IP CURLINFO_COOKIELIST
Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all
cookies cURL knows (expired ones, too). Don't forget to
+2 −1
Original line number Diff line number Diff line
@@ -1596,9 +1596,10 @@ typedef enum {
  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,
  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,
  /* Fill in new entries below here! */

  CURLINFO_LASTONE          = 31
  CURLINFO_LASTONE          = 32
} CURLINFO;

/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
+7 −2
Original line number Diff line number Diff line
@@ -775,9 +775,12 @@ singleipconnect(struct connectdata *conn,
  /* FIXME: do we have Curl_printable_address-like with struct sockaddr* as
     argument? */
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
  if(addr->family==AF_UNIX)
  if(addr->family==AF_UNIX) {
    infof(data, "  Trying %s... ",
          ((const struct sockaddr_un*)(&addr->addr))->sun_path);
    snprintf(data->info.ip, MAX_IPADR_LEN, "%s",
             ((const struct sockaddr_un*)(&addr->addr))->sun_path);
  }
  else
#endif
  {
@@ -789,8 +792,10 @@ singleipconnect(struct connectdata *conn,
      iptoprint = &((const struct sockaddr_in*)(&addr->addr))->sin_addr;

    if(Curl_inet_ntop(addr->family, iptoprint, addr_buf,
                      sizeof(addr_buf)) != NULL)
                      sizeof(addr_buf)) != NULL) {
      infof(data, "  Trying %s... ", addr_buf);
      snprintf(data->info.ip, MAX_IPADR_LEN, "%s", addr_buf);
    }
  }

  if(data->set.tcp_nodelay)
Loading