Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions doc/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -1677,11 +1677,6 @@ file_filter = locale/<lang>/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/<lang>/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/<lang>/LC_MESSAGES/developer-guide/api/types/TSServerSessionSharingMatchType.en.po
source_file = _build/locale/pot/developer-guide/api/types/TSServerSessionSharingMatchType.en.pot
Expand Down
42 changes: 0 additions & 42 deletions doc/developer-guide/api/types/TSSDKVersion.en.rst

This file was deleted.

This file was deleted.

8 changes: 1 addition & 7 deletions example/plugins/c-api/version/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion plugins/compress/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
15 changes: 5 additions & 10 deletions plugins/experimental/cookie_remap/cookie_remap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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");
Expand All @@ -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 {
Expand Down
9 changes: 2 additions & 7 deletions plugins/experimental/mysql_remap/mysql_remap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down
29 changes: 0 additions & 29 deletions plugins/regex_revalidate/regex_revalidate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &micro_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[])
{
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 0 additions & 6 deletions tests/gold_tests/continuations/plugins/session_id_verify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 0 additions & 6 deletions tests/tools/plugins/continuations_verify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
9 changes: 1 addition & 8 deletions tests/tools/plugins/hook_add_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ TSPluginInit(int argc, const char **argv)
info.support_email = const_cast<char *>("shinrich@verizonmedia.com");
info.vendor_name = const_cast<char *>("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;
}
Expand Down
10 changes: 0 additions & 10 deletions tests/tools/plugins/ssntxnorder_verify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -275,7 +274,6 @@ handle_order(TSCont contp, TSEvent event, void *edata)

break;
}
#endif

case TS_EVENT_IMMEDIATE:
TSStatIntIncrement(stat_test_done, 1);
Expand Down Expand Up @@ -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);
}

Expand All @@ -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
}
}
10 changes: 2 additions & 8 deletions tests/tools/plugins/test_log_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <ts/ts.h>
#include <string>
#include <string.h>
Expand Down Expand Up @@ -80,14 +81,7 @@ TSPluginInit(int argc, const char **argv)
info.support_email = const_cast<char *>("dev@trafficserver.apache.org");
info.vendor_name = const_cast<char *>("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;
}
Expand Down