aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib500.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c
index d22aecdbc..c28f5d0c9 100644
--- a/tests/libtest/lib500.c
+++ b/tests/libtest/lib500.c
@@ -14,6 +14,7 @@ int test(char *URL)
{
CURLcode res;
CURL *curl;
+ char *ipstr=NULL;
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
@@ -31,7 +32,17 @@ int test(char *URL)
res = curl_easy_perform(curl);
- curl_easy_cleanup(curl);
+ if(!res) {
+ FILE *moo;
+ res = curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ipstr);
+ moo = fopen(libtest_arg2, "wb");
+ if(moo) {
+ fprintf(moo, "IP: %s\n", ipstr);
+ fclose(moo);
+ }
+ }
+
+ curl_easy_cleanup(curl);
curl_global_cleanup();
return (int)res;