trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject [1/3] git commit: TS-1953: remove version check from stable plugins
Date Thu, 01 Aug 2013 22:29:45 GMT
Updated Branches:
  refs/heads/master 7e26b6845 -> be8fd6cd8


TS-1953: remove version check from stable plugins

we're closing the night with a cleanup in the stable plugins.
Thanks, You've been a great crowd.


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

Branch: refs/heads/master
Commit: be8fd6cd87e6a9b4a00c7f13bd5573165ad09103
Parents: a8febbf
Author: Igor Galić <i.galic@brainsware.org>
Authored: Fri Aug 2 00:26:56 2013 +0200
Committer: Igor Galić <i.galic@brainsware.org>
Committed: Fri Aug 2 00:29:31 2013 +0200

----------------------------------------------------------------------
 plugins/cacheurl/cacheurl.c               | 31 --------------------------
 plugins/gzip/gzip.cc                      |  3 ---
 plugins/gzip/misc.cc                      | 15 -------------
 plugins/stats_over_http/stats_over_http.c | 29 ------------------------
 4 files changed, 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/be8fd6cd/plugins/cacheurl/cacheurl.c
----------------------------------------------------------------------
diff --git a/plugins/cacheurl/cacheurl.c b/plugins/cacheurl/cacheurl.c
index 2f34729..7b28d7d 100644
--- a/plugins/cacheurl/cacheurl.c
+++ b/plugins/cacheurl/cacheurl.c
@@ -361,32 +361,6 @@ static int handle_hook(TSCont contp, TSEvent event, void *edata) {
     return ok;
 }
 
-/* Function to ensure we're running a recent enough version of Traffic Server.
- * (Taken from the example plugin)
- */
-static int check_ts_version() {
-  const char *ts_version = TSTrafficServerVersionGet();
-  int result = 0;
-
-  if (ts_version) {
-    int major_ts_version = 0;
-    int minor_ts_version = 0;
-    int patch_ts_version = 0;
-
-    if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version,
-                &patch_ts_version) != 3) {
-      return 0;
-    }
-
-    /* we are now v3.x */
-    if (major_ts_version >= 3) {
-      result = 1;
-    }
-
-  }
-  return result;
-}
-
 /* Generic error message function for errors in plugin initialization */
 static void initialization_error(char *msg) {
     TSError("[%s] %s\n", PLUGIN_NAME, msg);
@@ -479,11 +453,6 @@ void TSPluginInit(int argc, const char *argv[]) {
         return;
     }
 
-    if (!check_ts_version()) {
-        initialization_error("Plugin requires Traffic Server 3.0 or later");
-        return;
-    }
-
     if (!log) {
         error = TSTextLogObjectCreate("cacheurl", TS_LOG_MODE_ADD_TIMESTAMP,
                 &log);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/be8fd6cd/plugins/gzip/gzip.cc
----------------------------------------------------------------------
diff --git a/plugins/gzip/gzip.cc b/plugins/gzip/gzip.cc
index 9260faf..9c84dc8 100644
--- a/plugins/gzip/gzip.cc
+++ b/plugins/gzip/gzip.cc
@@ -773,9 +773,6 @@ TSPluginInit(int argc, const char *argv[])
   if (!register_plugin()) {
     fatal("The gzip plugin failed to register");
   }
-  if (!check_ts_version()) {
-    fatal("The gzip plugin requires at least traffic server v3");
-  }
 
   //if (argc == 2) {
   //  dictionary = load_dictionary(argv[1]);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/be8fd6cd/plugins/gzip/misc.cc
----------------------------------------------------------------------
diff --git a/plugins/gzip/misc.cc b/plugins/gzip/misc.cc
index 5fb98a5..13f9d39 100644
--- a/plugins/gzip/misc.cc
+++ b/plugins/gzip/misc.cc
@@ -140,21 +140,6 @@ init_hidden_header_name()
 }
 
 int
-check_ts_version()
-{
-  const char *ts_version = TSTrafficServerVersionGet();
-  TSReleaseAssert(ts_version);
-
-  int scan_result;
-  int major_version;
-
-  scan_result = sscanf(ts_version, "%d", &major_version);
-  TSReleaseAssert(scan_result == 1);
-
-  return major_version >= 3;
-}
-
-int
 register_plugin()
 {
   TSPluginRegistrationInfo info;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/be8fd6cd/plugins/stats_over_http/stats_over_http.c
----------------------------------------------------------------------
diff --git a/plugins/stats_over_http/stats_over_http.c b/plugins/stats_over_http/stats_over_http.c
index c91de51..89a13af 100644
--- a/plugins/stats_over_http/stats_over_http.c
+++ b/plugins/stats_over_http/stats_over_http.c
@@ -249,30 +249,6 @@ stats_origin(TSCont contp ATS_UNUSED, TSEvent event ATS_UNUSED, void
*edata)
   return 0;
 }
 
-int
-check_ts_version()
-{
-  const char *ts_version = TSTrafficServerVersionGet();
-  int result = 0;
-
-  if (ts_version) {
-    int major_ts_version = 0;
-    int minor_ts_version = 0;
-    int patch_ts_version = 0;
-
-    if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, &patch_ts_version)
!= 3) {
-      return 0;
-    }
-
-    /* Need at least TS 2.0 */
-    if (major_ts_version >= 2) {
-      result = 1;
-    }
-  }
-
-  return result;
-}
-
 void
 TSPluginInit(int argc, const char *argv[])
 {
@@ -285,11 +261,6 @@ TSPluginInit(int argc, const char *argv[])
   if (TSPluginRegister(TS_SDK_VERSION_2_0, &info) != TS_SUCCESS)
     TSError("Plugin registration failed. \n");
 
-  if (!check_ts_version()) {
-    TSError("Plugin requires Traffic Server 2.0 or later\n");
-    return;
-  }
-
   if (argc > 1) {
     url_path = TSstrdup(argv[1] + ('/' == argv[1][0] ? 1 : 0)); /* Skip leading / */
   }


Mime
View raw message