diff --git a/doc/.tx/config b/doc/.tx/config index 5ddb7228b08..81bc05858c5 100644 --- a/doc/.tx/config +++ b/doc/.tx/config @@ -1677,11 +1677,6 @@ file_filter = locale//LC_MESSAGES/developer-guide/api/types/TSReturnCode.e source_file = _build/locale/pot/developer-guide/api/types/TSReturnCode.en.pot source_lang = en -[apache-traffic-server-6x.developer-guide--api--types--TSSDKVersion_en] -file_filter = locale//LC_MESSAGES/developer-guide/api/types/TSSDKVersion.en.po -source_file = _build/locale/pot/developer-guide/api/types/TSSDKVersion.en.pot -source_lang = en - [apache-traffic-server-6x.developer-guide--api--types--TSServerSessionSharingMatchType_en] file_filter = locale//LC_MESSAGES/developer-guide/api/types/TSServerSessionSharingMatchType.en.po source_file = _build/locale/pot/developer-guide/api/types/TSServerSessionSharingMatchType.en.pot diff --git a/doc/developer-guide/api/types/TSSDKVersion.en.rst b/doc/developer-guide/api/types/TSSDKVersion.en.rst deleted file mode 100644 index 323e911a383..00000000000 --- a/doc/developer-guide/api/types/TSSDKVersion.en.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed - with this work for additional information regarding copyright - ownership. The ASF licenses this file to you under the Apache - License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - -.. include:: ../../../common.defs - -TSSDKVersion -************ - -Synopsis -======== - -.. code-block:: cpp - - #include - -.. c:type:: TSSDKVersion - -Enum typedef. - -Enumeration Members -=================== - -.. c:member:: TSSDKVersion TS_SDK_VERSION_2_0 - -.. c:member:: TSSDKVersion TS_SDK_VERSION_3_0 - -Description -=========== - diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSSDKVersion.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSSDKVersion.en.po deleted file mode 100644 index 70b1fa1bebf..00000000000 --- a/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSSDKVersion.en.po +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Apache Traffic Server 6.2\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-02 21:32+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: ja_JP\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.1.1\n" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:39 -msgid "Description" -msgstr "解説" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:29 -msgid "Enum typedef." -msgstr "" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:32 -msgid "Enumeration Members" -msgstr "" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:23 -msgid "Synopsis" -msgstr "概要" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:20 -msgid "TSSDKVersion" -msgstr "" - -#: ../../developer-guide/api/types/TSSDKVersion.en.rst:25 -msgid "`#include `" -msgstr "" diff --git a/example/plugins/c-api/version/version.c b/example/plugins/c-api/version/version.c index 7e2baf1b343..bc1c86a5090 100644 --- a/example/plugins/c-api/version/version.c +++ b/example/plugins/c-api/version/version.c @@ -54,14 +54,8 @@ TSPluginInit(int argc, const char *argv[]) info.vendor_name = "Apache Software Foundation"; info.support_email = "dev@trafficserver.apache.org"; -// partial compilation -#if (TS_VERSION_NUMBER < 3000000) - if (TSPluginRegister(TS_SDK_VERSION_2_0, &info) != TS_SUCCESS) { -#elif (TS_VERSION_NUMBER < 6000000) - if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) { -#else + // partial compilation if (TSPluginRegister(&info) != TS_SUCCESS) { -#endif TSError("[%s] Plugin registration failed.", PLUGIN_NAME); } diff --git a/plugins/compress/misc.h b/plugins/compress/misc.h index a42c3e8b08b..0ae6947cbd7 100644 --- a/plugins/compress/misc.h +++ b/plugins/compress/misc.h @@ -94,6 +94,5 @@ void normalize_accept_encoding(TSHttpTxn txnp, TSMBuffer reqp, TSMLoc hdr_loc); void hide_accept_encoding(TSHttpTxn txnp, TSMBuffer reqp, TSMLoc hdr_loc, const char *hidden_header_name); void restore_accept_encoding(TSHttpTxn txnp, TSMBuffer reqp, TSMLoc hdr_loc, const char *hidden_header_name); const char *init_hidden_header_name(); -int check_ts_version(); int register_plugin(); void log_compression_ratio(int64_t in, int64_t out); diff --git a/plugins/experimental/cookie_remap/cookie_remap.cc b/plugins/experimental/cookie_remap/cookie_remap.cc index 421c52d6c04..cdbe89733d8 100644 --- a/plugins/experimental/cookie_remap/cookie_remap.cc +++ b/plugins/experimental/cookie_remap/cookie_remap.cc @@ -43,13 +43,8 @@ using namespace std; // for bucketizing #define MY_NAME "cookie_remap" -const int OVECCOUNT = 30; // We support $1 - $9 only, and this needs to be 3x that -#if TS_VERSION_MAJOR > 7 -#define SETHTTPSTATUS(TXN, STATUS) TSHttpTxnStatusSet((TXN), STATUS) -#else -#define SETHTTPSTATUS(TXN, STATUS) TSHttpTxnSetHttpRetStatus((TXN), STATUS) -#endif +const int OVECCOUNT = 30; // We support $1 - $9 only, and this needs to be 3x that /////////////////////////////////////////////////////////////////////////////// // Helpers for memory management (to make sure pcre uses the TS APIs). @@ -1079,18 +1074,18 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri) // Maybe set the return status if (status > TS_HTTP_STATUS_NONE) { TSDebug(MY_NAME, "Setting return status to %d", status); - SETHTTPSTATUS(txnp, status); + TSHttpTxnStatusSet(txnp, status); if ((status == TS_HTTP_STATUS_MOVED_PERMANENTLY) || (status == TS_HTTP_STATUS_MOVED_TEMPORARILY)) { if (rewrite_to.size() > 8192) { TSError("Redirect in target " "URL too long"); - SETHTTPSTATUS(txnp, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG); + TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG); } else { const char *start = rewrite_to.c_str(); int dest_len = rewrite_to.size(); if (TS_PARSE_ERROR == TSUrlParse(rri->requestBufp, rri->requestUrl, &start, start + dest_len)) { - SETHTTPSTATUS(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR); + TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR); TSError("can't parse " "substituted " "URL string"); @@ -1113,7 +1108,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri) // set the new url if (TSUrlParse(rri->requestBufp, rri->requestUrl, &start, start + rewrite_to.length()) == TS_PARSE_ERROR) { - SETHTTPSTATUS(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR); + TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR); TSError("can't parse substituted URL string"); goto error; } else { diff --git a/plugins/experimental/mysql_remap/mysql_remap.cc b/plugins/experimental/mysql_remap/mysql_remap.cc index d43637003c3..f2c69b26486 100644 --- a/plugins/experimental/mysql_remap/mysql_remap.cc +++ b/plugins/experimental/mysql_remap/mysql_remap.cc @@ -129,14 +129,9 @@ do_mysql_remap(TSCont contp, TSHttpTxn txnp) TSHttpHdrStatusSet(reqp, hdr_loc, TS_HTTP_STATUS_NOT_FOUND); TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_NOT_FOUND); } - if (res) + if (res) { mysql_free_result(res); -#if (TS_VERSION_NUMBER < 2001005) - if (request_host) - TSHandleStringRelease(reqp, hdr_loc, request_host); - if (request_scheme) - TSHandleStringRelease(reqp, hdr_loc, request_scheme); -#endif + } release_field: if (field_loc) { TSHandleMLocRelease(reqp, hdr_loc, field_loc); diff --git a/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc b/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc index 64b03dfbdf3..70fe13bd53b 100644 --- a/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc +++ b/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc @@ -52,15 +52,11 @@ TSPluginInit(int argc, const char *argv[]) TSLifecycleHookAdd(TS_LIFECYCLE_SHUTDOWN_HOOK, TSContCreate(shutdown_handler, nullptr)); -#if (TS_VERSION_NUMBER >= 7000000) if (TSPluginRegister(&info) != TS_SUCCESS) { TSError("Plugin registration failed."); + return; } -#else - if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) { - TSError("Plugin registration failed."); - } -#endif + if (argc < 2) { TSError("Must specify config file."); } else if (!init_ssl_params(argv[1])) { diff --git a/plugins/regex_revalidate/regex_revalidate.c b/plugins/regex_revalidate/regex_revalidate.c index d7ff7065639..4d0ff8bbbd6 100644 --- a/plugins/regex_revalidate/regex_revalidate.c +++ b/plugins/regex_revalidate/regex_revalidate.c @@ -454,29 +454,6 @@ main_handler(TSCont cont, TSEvent event, void *edata) return 0; } -static bool -check_ts_version() -{ - const char *ts_version = TSTrafficServerVersionGet(); - - if (ts_version) { - int major_ts_version = 0; - int minor_ts_version = 0; - int micro_ts_version = 0; - - if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, µ_ts_version) != 3) { - return false; - } - - if ((TS_VERSION_MAJOR == major_ts_version) && (TS_VERSION_MINOR == minor_ts_version) && - (TS_VERSION_MICRO == micro_ts_version)) { - return true; - } - } - - return false; -} - void TSPluginInit(int argc, const char *argv[]) { @@ -543,12 +520,6 @@ TSPluginInit(int argc, const char *argv[]) TSDebug(LOG_PREFIX, "Plugin registration succeeded"); } - if (!check_ts_version()) { - TSError("[regex_revalidate] Plugin requires Traffic Server %d.%d.%d", TS_VERSION_MAJOR, TS_VERSION_MINOR, TS_VERSION_MICRO); - free_plugin_state_t(pstate); - return; - } - pcre_malloc = &ts_malloc; pcre_free = &ts_free; diff --git a/tests/gold_tests/continuations/plugins/session_id_verify.cc b/tests/gold_tests/continuations/plugins/session_id_verify.cc index 75b58f2f5f1..4a3b5e3377e 100644 --- a/tests/gold_tests/continuations/plugins/session_id_verify.cc +++ b/tests/gold_tests/continuations/plugins/session_id_verify.cc @@ -70,13 +70,7 @@ TSPluginInit(int argc, const char *argv[]) info.vendor_name = vendor_name; info.support_email = support_email; -#if (TS_VERSION_MAJOR < 3) - if (TSPluginRegister(TS_SDK_VERSION_2_0, &info) != TS_SUCCESS) { -#elif (TS_VERSION_MAJOR < 6) - if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) { -#else if (TSPluginRegister(&info) != TS_SUCCESS) { -#endif TSError("[%s] Plugin registration failed.", PLUGIN_NAME); } diff --git a/tests/tools/plugins/continuations_verify.cc b/tests/tools/plugins/continuations_verify.cc index 079c0495b28..6ad633e5a6d 100644 --- a/tests/tools/plugins/continuations_verify.cc +++ b/tests/tools/plugins/continuations_verify.cc @@ -147,13 +147,7 @@ TSPluginInit(int argc, const char *argv[]) info.vendor_name = vendor_name; info.support_email = support_email; -#if (TS_VERSION_MAJOR < 3) - if (TSPluginRegister(TS_SDK_VERSION_2_0, &info) != TS_SUCCESS) { -#elif (TS_VERSION_MAJOR < 6) - if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) { -#else if (TSPluginRegister(&info) != TS_SUCCESS) { -#endif TSError("[%s] Plugin registration failed. \n", plugin_name); } diff --git a/tests/tools/plugins/hook_add_plugin.cc b/tests/tools/plugins/hook_add_plugin.cc index f8fcfe47af2..adc9504139d 100644 --- a/tests/tools/plugins/hook_add_plugin.cc +++ b/tests/tools/plugins/hook_add_plugin.cc @@ -122,14 +122,7 @@ TSPluginInit(int argc, const char **argv) info.support_email = const_cast("shinrich@verizonmedia.com"); info.vendor_name = const_cast("Verizon Media"); - TSReturnCode ret; -#if (TS_VERSION_MAJOR >= 7) - ret = TSPluginRegister(&info); -#else - ret = TSPluginRegister(TS_SDK_VERSION_3_0, &info); -#endif - - if (TS_ERROR == ret) { + if (TSPluginRegister(&info) != TS_SUCCESS) { TSError("[" PLUGIN_TAG "] plugin registration failed\n"); return; } diff --git a/tests/tools/plugins/ssntxnorder_verify.cc b/tests/tools/plugins/ssntxnorder_verify.cc index 5d9a53948fe..276fec95da6 100644 --- a/tests/tools/plugins/ssntxnorder_verify.cc +++ b/tests/tools/plugins/ssntxnorder_verify.cc @@ -260,7 +260,6 @@ handle_order(TSCont contp, TSEvent event, void *edata) break; } -#if ((TS_VERSION_MAJOR == 6 && TS_VERSION_MINOR >= 2) || TS_VERSION_MAJOR > 6) case TS_EVENT_LIFECYCLE_MSG: // External trigger, such as traffic_ctl { TSDebug(DEBUG_TAG_HOOK, "event TS_EVENT_LIFECYCLE_MSG"); @@ -275,7 +274,6 @@ handle_order(TSCont contp, TSEvent event, void *edata) break; } -#endif case TS_EVENT_IMMEDIATE: TSStatIntIncrement(stat_test_done, 1); @@ -308,13 +306,7 @@ TSPluginInit(int argc, const char *argv[]) info.vendor_name = vendor_name; info.support_email = support_email; -#if (TS_VERSION_MAJOR < 3) - if (TSPluginRegister(TS_SDK_VERSION_2_0, &info) != TS_SUCCESS) { -#elif (TS_VERSION_MAJOR < 6) - if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) { -#else if (TSPluginRegister(&info) != TS_SUCCESS) { -#endif TSDebug(DEBUG_TAG_HOOK, "[%s] Plugin registration failed. \n", plugin_name); } @@ -340,8 +332,6 @@ TSPluginInit(int argc, const char *argv[]) TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, contp); TSHttpHookAdd(TS_HTTP_TXN_CLOSE_HOOK, contp); -#if ((TS_VERSION_MAJOR == 6 && TS_VERSION_MINOR >= 2) || TS_VERSION_MAJOR > 6) TSLifecycleHookAdd(TS_LIFECYCLE_MSG_HOOK, contp); -#endif } } diff --git a/tests/tools/plugins/test_log_interface.cc b/tests/tools/plugins/test_log_interface.cc index b0f44f7c68d..4e85fc07c6c 100644 --- a/tests/tools/plugins/test_log_interface.cc +++ b/tests/tools/plugins/test_log_interface.cc @@ -20,6 +20,7 @@ See the License for the specific language governing permissions and limitations under the License. */ + #include #include #include @@ -80,14 +81,7 @@ TSPluginInit(int argc, const char **argv) info.support_email = const_cast("dev@trafficserver.apache.org"); info.vendor_name = const_cast("Verizon Media"); - TSReturnCode ret; -#if (TS_VERSION_MAJOR >= 7) - ret = TSPluginRegister(&info); -#else - ret = TSPluginRegister(TS_SDK_VERSION_3_0, &info); -#endif - - if (TS_ERROR == ret) { + if (TSPluginRegister(&info) != TS_SUCCESS) { TSError("[%s] plugin registration failed\n", plugin_name); return; }