trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject trafficserver git commit: TS-3639 Adds missing ifdef checks for build time
Date Sat, 26 Mar 2016 19:52:00 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 24893fc94 -> b1b8267ab


TS-3639 Adds missing ifdef checks for build time


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b1b8267a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b1b8267a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b1b8267a

Branch: refs/heads/master
Commit: b1b8267ab61c92623356e1ff26152f930c85e76d
Parents: 24893fc
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Sat Mar 26 13:51:32 2016 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Sat Mar 26 13:51:32 2016 -0600

----------------------------------------------------------------------
 plugins/header_rewrite/conditions.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b1b8267a/plugins/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc
index c8a0008..63800a6 100644
--- a/plugins/header_rewrite/conditions.cc
+++ b/plugins/header_rewrite/conditions.cc
@@ -713,6 +713,7 @@ ConditionNow::eval(const Resources &res)
 
 
 // ConditionGeo: Geo-based information (integer). See ConditionGeoCountry for the string
version.
+#if HAVE_GEOIP_H
 const char *
 ConditionGeo::get_geo_string(const sockaddr *addr)
 {
@@ -845,6 +846,27 @@ ConditionGeo::get_geo_int(const sockaddr *addr)
   return ret;
 }
 
+#else
+
+// No Geo library avaiable, these are just stubs.
+
+const char *
+ConditionGeo::get_geo_string(const sockaddr *addr)
+{
+  TSError("[%s] No Geo library available!", PLUGIN_NAME);
+  return NULL;
+}
+
+int64_t
+ConditionGeo::get_geo_int(const sockaddr *addr)
+{
+  TSError("[%s] No Geo library available!", PLUGIN_NAME);
+  return 0;
+}
+
+#endif
+
+
 void
 ConditionGeo::initialize(Parser &p)
 {


Mime
View raw message