summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c179fe)
raw | patch | inline | side by side (parent: 2c179fe)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 30 May 2016 21:10:08 +0000 (23:10 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 10 Jun 2016 19:04:49 +0000 (21:04 +0200) |
It's available since cURL 7.19 but RHEL5 ships an older version.
configure.ac | patch | blob | history | |
src/utils_curl_stats.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 145f3936d95055c17843ecfd089a5d2171ae6ee8..4437aeef7a9c6db152928f144dfac3629fb35acf 100644 (file)
--- a/configure.ac
+++ b/configure.ac
[[#include <curl/curl.h>]])
fi
fi
+if test "x$with_libcurl" = "xyes"
+then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_curl_cflags"
+ LDFLAGS="$LDFLAGS $curl_curl_libs"
+ AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
+ [c_cv_have_curlinfo_appconnect_time],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include <curl/curl.h>
+]]],
+[[[
+int val = CURLINFO_APPCONNECT_TIME;
+return val;
+]]]
+ )],
+ [c_cv_have_curlinfo_appconnect_time="yes"],
+ [c_cv_have_curlinfo_appconnect_time="no"]
+ )
+ )
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
+if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
+then
+ AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
+fi
+
if test "x$with_libcurl" = "xyes"
then
BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
diff --git a/src/utils_curl_stats.c b/src/utils_curl_stats.c
index 5a37083a0aa6e680c26852b4cd6e1307386315f1..b242a239b6f667d61b1c8aeae92805e51a51bfec 100644 (file)
--- a/src/utils_curl_stats.c
+++ b/src/utils_curl_stats.c
SPEC (redirect_time, "RedirectTime", dispatch_gauge, "duration", CURLINFO_REDIRECT_TIME),
SPEC (redirect_count, "RedirectCount", dispatch_size, "count", CURLINFO_REDIRECT_COUNT),
SPEC (num_connects, "NumConnects", dispatch_size, "count", CURLINFO_NUM_CONNECTS),
+#ifdef HAVE_CURLINFO_APPCONNECT_TIME
SPEC (appconnect_time, "AppconnectTime", dispatch_gauge, "duration", CURLINFO_APPCONNECT_TIME),
+#endif
#undef SPEC
};