You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/06/23 22:27:11 UTC
[1/3] trafficserver git commit: TS-2106 Added plugin names to all
TSError messages. Removed extraneous newlines. This closes #220.
Repository: trafficserver
Updated Branches:
refs/heads/master 94476aa17 -> 28b243b06
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_server_request.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_server_request.c b/plugins/experimental/ts_lua/ts_lua_server_request.c
index 6d24089..a980615 100644
--- a/plugins/experimental/ts_lua/ts_lua_server_request.c
+++ b/plugins/experimental/ts_lua/ts_lua_server_request.c
@@ -211,7 +211,7 @@ ts_lua_server_request_header_set(lua_State *L)
} else if (TSMimeHdrFieldCreateNamed(http_ctx->server_request_bufp, http_ctx->server_request_hdrp, key, key_len, &field_loc) !=
TS_SUCCESS) {
- TSError("[%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
+ TSError("[ts_lua][%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
return 0;
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_server_response.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_server_response.c b/plugins/experimental/ts_lua/ts_lua_server_response.c
index 7d7e249..24bbef9 100644
--- a/plugins/experimental/ts_lua/ts_lua_server_response.c
+++ b/plugins/experimental/ts_lua/ts_lua_server_response.c
@@ -211,7 +211,7 @@ ts_lua_server_response_header_set(lua_State *L)
} else if (TSMimeHdrFieldCreateNamed(http_ctx->server_response_bufp, http_ctx->server_response_hdrp, key, key_len, &field_loc) !=
TS_SUCCESS) {
- TSError("[%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
+ TSError("[ts_lua][%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
return 0;
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_transform.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_transform.c b/plugins/experimental/ts_lua/ts_lua_transform.c
index d19ab3f..f7e2175 100644
--- a/plugins/experimental/ts_lua/ts_lua_transform.c
+++ b/plugins/experimental/ts_lua/ts_lua_transform.c
@@ -189,7 +189,7 @@ ts_lua_transform_handler(TSCont contp, ts_lua_http_transform_ctx *transform_ctx,
break;
default: // coroutine failed
- TSError("lua_resume failed: %s", lua_tostring(L, -1));
+ TSError("[ts_lua] lua_resume failed: %s", lua_tostring(L, -1));
ret = 1;
res = NULL;
res_len = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_util.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_util.c b/plugins/experimental/ts_lua/ts_lua_util.c
index 7353e81..ddef163 100644
--- a/plugins/experimental/ts_lua/ts_lua_util.c
+++ b/plugins/experimental/ts_lua/ts_lua_util.c
@@ -214,7 +214,7 @@ ts_lua_del_module(ts_lua_instance_conf *conf, ts_lua_main_ctx *arr, int n)
if (lua_type(L, -1) == LUA_TFUNCTION) {
if (lua_pcall(L, 0, 0, 0)) {
- TSError("[%s] lua_pcall %s failed: %s", __FUNCTION__, conf->script, lua_tostring(L, -1));
+ TSError("[ts_lua][%s] lua_pcall %s failed: %s", __FUNCTION__, conf->script, lua_tostring(L, -1));
}
} else {
@@ -733,7 +733,7 @@ ts_lua_http_cont_handler(TSCont contp, TSEvent ev, void *edata)
lua_getglobal(L, TS_LUA_FUNCTION_TXN_CLOSE);
if (lua_type(L, -1) == LUA_TFUNCTION) {
if (lua_pcall(L, 0, 1, 0)) {
- TSError("lua_pcall failed: %s", lua_tostring(L, -1));
+ TSError("[ts_lua] lua_pcall failed: %s", lua_tostring(L, -1));
}
}
@@ -762,7 +762,7 @@ ts_lua_http_cont_handler(TSCont contp, TSEvent ev, void *edata)
break;
default: // coroutine failed
- TSError("lua_resume failed: %s", lua_tostring(L, -1));
+ TSError("[ts_lua] lua_resume failed: %s", lua_tostring(L, -1));
rc = -1;
lua_pop(L, 1);
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/url_sig/url_sig.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/url_sig/url_sig.c b/plugins/experimental/url_sig/url_sig.c
index 477cbc6..046800d 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -53,7 +53,7 @@ struct config {
static void
free_cfg(struct config *cfg)
{
- TSError("Cleaning up...");
+ TSError("[url_sig] Cleaning up...");
TSfree(cfg->err_url);
if (cfg->regex_extra)
@@ -124,7 +124,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
continue;
char *pos = strchr(line, '=');
if (pos == NULL) {
- TSError("Error parsing line %d of file %s (%s).", line_no, config_file, line);
+ TSError("[url_sig] Error parsing line %d of file %s (%s).", line_no, config_file, line);
continue;
}
*pos = '\0';
@@ -193,7 +193,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
cfg->regex, options, &errptr); // We do not need to check the error here because we can still run without the studying?
}
} else {
- TSError("Error parsing line %d of file %s (%s).", line_no, config_file, line);
+ TSError("[url_sig] Error parsing line %d of file %s (%s).", line_no, config_file, line);
}
}
@@ -238,9 +238,9 @@ err_log(char *url, char *msg)
{
if (msg && url) {
TSDebug(PLUGIN_NAME, "[URL=%s]: %s", url, msg);
- TSError("[URL=%s]: %s", url, msg); // This goes to error.log
+ TSError("[url_sig] [URL=%s]: %s", url, msg); // This goes to error.log
} else {
- TSError("Invalid err_log request");
+ TSError("[url_sig] Invalid err_log request");
}
}
@@ -513,7 +513,7 @@ allow:
/* drop the query string so we can cache-hit */
rval = TSUrlHttpQuerySet(rri->requestBufp, rri->requestUrl, NULL, 0);
if (rval != TS_SUCCESS) {
- TSError("Error stripping query string: %d.", rval);
+ TSError("[url_sig] Error stripping query string: %d.", rval);
}
return TSREMAP_NO_REMAP;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/xdebug/xdebug.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/xdebug/xdebug.cc b/plugins/experimental/xdebug/xdebug.cc
index 9adcd73..ce60244 100644
--- a/plugins/experimental/xdebug/xdebug.cc
+++ b/plugins/experimental/xdebug/xdebug.cc
@@ -351,7 +351,7 @@ TSPluginInit(int /* argc */, const char * /*argv */ [])
info.support_email = (char *)"dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("xdebug plugin registration failed");
+ TSError("[xdebug] Plugin registration failed");
}
TSReleaseAssert(TSHttpArgIndexReserve("xdebug", "xdebug header requests", &XArgIndex) == TS_SUCCESS);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/condition.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/condition.cc b/plugins/header_rewrite/condition.cc
index 9d0232b..834d6bd 100644
--- a/plugins/header_rewrite/condition.cc
+++ b/plugins/header_rewrite/condition.cc
@@ -61,7 +61,7 @@ Condition::initialize(Parser &p)
if (p.mod_exist("OR")) {
if (p.mod_exist("AND")) {
- TSError("%s: Can't have both AND and OR in mods", PLUGIN_NAME);
+ TSError("[%s] Can't have both AND and OR in mods", PLUGIN_NAME);
} else {
_mods = static_cast<CondModifiers>(_mods | COND_OR);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc
index 0264d9e..696e1da 100644
--- a/plugins/header_rewrite/conditions.cc
+++ b/plugins/header_rewrite/conditions.cc
@@ -384,7 +384,7 @@ ConditionUrl::eval(const Resources &res)
TSDebug(PLUGIN_NAME, " Using the to url");
url = res._rri->mapToUrl;
} else {
- TSError("header_rewrite: Invalid option value");
+ TSError("[header_rewrite] Invalid option value");
return false;
}
} else {
@@ -396,11 +396,11 @@ ConditionUrl::eval(const Resources &res)
bufp = res.bufp;
hdr_loc = res.hdr_loc;
} else {
- TSError("header_rewrite: Rule not supported at this hook");
+ TSError("[header_rewrite] Rule not supported at this hook");
return false;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url) != TS_SUCCESS) {
- TSError("header_rewrite: Error getting the URL");
+ TSError("[header_rewrite] Error getting the URL");
return false;
}
}
@@ -438,7 +438,7 @@ ConditionDBM::initialize(Parser &p)
// TSError("Failed to open DBM file: %s", _file.c_str());
// }
} else {
- TSError("%s: Malformed DBM condition", PLUGIN_NAME);
+ TSError("[%s] Malformed DBM condition", PLUGIN_NAME);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/factory.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/factory.cc b/plugins/header_rewrite/factory.cc
index 3305932..89cfe40 100644
--- a/plugins/header_rewrite/factory.cc
+++ b/plugins/header_rewrite/factory.cc
@@ -60,7 +60,7 @@ operator_factory(const std::string &op)
} else if (op == "set-conn-dscp") {
o = new OperatorSetConnDSCP();
} else {
- TSError("%s: unknown operator: %s", PLUGIN_NAME, op.c_str());
+ TSError("[%s] Unknown operator: %s", PLUGIN_NAME, op.c_str());
return NULL;
}
@@ -126,7 +126,7 @@ condition_factory(const std::string &cond)
} else if (c_name == "TXN-COUNT") {
c = new ConditionTransactCount();
} else {
- TSError("%s: unknown condition: %s", PLUGIN_NAME, c_name.c_str());
+ TSError("[%s] Unknown condition: %s", PLUGIN_NAME, c_name.c_str());
return NULL;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/header_rewrite.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/header_rewrite.cc b/plugins/header_rewrite/header_rewrite.cc
index db78745..3f2dea4 100644
--- a/plugins/header_rewrite/header_rewrite.cc
+++ b/plugins/header_rewrite/header_rewrite.cc
@@ -129,7 +129,7 @@ RulesConfig::parse_config(const std::string fname, TSHttpHookID default_hook)
int lineno = 0;
if (0 == fname.size()) {
- TSError("%s: no config filename provided", PLUGIN_NAME);
+ TSError("[%s] no config filename provided", PLUGIN_NAME);
return false;
}
@@ -142,7 +142,7 @@ RulesConfig::parse_config(const std::string fname, TSHttpHookID default_hook)
f.open(filename.c_str(), std::ios::in);
if (!f.is_open()) {
- TSError("%s: unable to open %s", PLUGIN_NAME, filename.c_str());
+ TSError("[%s] unable to open %s", PLUGIN_NAME, filename.c_str());
return false;
}
@@ -253,7 +253,7 @@ cont_rewrite_headers(TSCont contp, TSEvent event, void *edata)
conf->release();
break;
default:
- TSError("%s: unknown event for this plugin", PLUGIN_NAME);
+ TSError("[%s] unknown event for this plugin", PLUGIN_NAME);
TSDebug(PLUGIN_NAME, "unknown event for this plugin");
break;
}
@@ -296,7 +296,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = (char *)"dev@trafficserver.apache.org";
if (TS_SUCCESS != TSPluginRegister(&info)) {
- TSError("%s: plugin registration failed.\n", PLUGIN_NAME);
+ TSError("[%s] plugin registration failed.", PLUGIN_NAME);
}
// Parse the global config file(s). All rules are just appended
@@ -314,7 +314,7 @@ TSPluginInit(int argc, const char *argv[])
TSDebug(PLUGIN_NAME, "Succesfully loaded global config file %s", argv[i]);
got_config = true;
} else {
- TSError("header_rewrite: failed to parse configuration file %s", argv[i]);
+ TSError("[header_rewrite] failed to parse configuration file %s", argv[i]);
}
}
@@ -330,7 +330,7 @@ TSPluginInit(int argc, const char *argv[])
}
} else {
// Didn't get anything, nuke it.
- TSError("%s: failed to parse configuration file", PLUGIN_NAME);
+ TSError("[%s] failed to parse configuration file", PLUGIN_NAME);
conf->release();
}
}
@@ -369,7 +369,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
TSDebug(PLUGIN_NAME, "Instantiating a new remap.config plugin rule");
if (argc < 3) {
- TSError("%s: Unable to create remap instance, need config file", PLUGIN_NAME);
+ TSError("[%s] Unable to create remap instance, need config file", PLUGIN_NAME);
return TS_ERROR;
}
@@ -380,7 +380,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
for (int i = 2; i < argc; ++i) {
TSDebug(PLUGIN_NAME, "Loading remap configuration file %s", argv[i]);
if (!conf->parse_config(argv[i], TS_REMAP_PSEUDO_HOOK)) {
- TSError("%s: Unable to create remap instance", PLUGIN_NAME);
+ TSError("[%s] Unable to create remap instance", PLUGIN_NAME);
return TS_ERROR;
} else {
TSDebug(PLUGIN_NAME, "Succesfully loaded remap config file %s", argv[i]);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/operators.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc
index 173104f..7f7eed7 100644
--- a/plugins/header_rewrite/operators.cc
+++ b/plugins/header_rewrite/operators.cc
@@ -38,7 +38,7 @@ OperatorSetConfig::initialize(Parser &p)
_value.set_value(p.get_value());
} else {
_key = TS_CONFIG_NULL;
- TSError("%s: no such records config: %s", PLUGIN_NAME, _config.c_str());
+ TSError("[%s] no such records config: %s", PLUGIN_NAME, _config.c_str());
}
}
@@ -64,7 +64,7 @@ OperatorSetConfig::exec(const Resources &res) const
}
break;
default:
- TSError("%s: unknown data type, whut?", PLUGIN_NAME);
+ TSError("[%s] unknown data type, whut?", PLUGIN_NAME);
break;
}
}
@@ -80,7 +80,7 @@ OperatorSetStatus::initialize(Parser &p)
_status.set_value(p.get_arg());
if (NULL == (_reason = TSHttpHdrReasonLookup((TSHttpStatus)_status.get_int_value()))) {
- TSError("%s: unknown status %d", PLUGIN_NAME, _status.get_int_value());
+ TSError("[%s] unknown status %d", PLUGIN_NAME, _status.get_int_value());
_reason_len = 0;
} else {
_reason_len = strlen(_reason);
@@ -278,7 +278,7 @@ OperatorSetRedirect::initialize(Parser &p)
if ((_status.get_int_value() != (int)TS_HTTP_STATUS_MOVED_PERMANENTLY) &&
(_status.get_int_value() != (int)TS_HTTP_STATUS_MOVED_TEMPORARILY)) {
- TSError("%s: unsupported redirect status %d", PLUGIN_NAME, _status.get_int_value());
+ TSError("[%s] unsupported redirect status %d", PLUGIN_NAME, _status.get_int_value());
}
require_resources(RSRC_SERVER_RESPONSE_HEADERS);
@@ -358,7 +358,7 @@ OperatorSetTimeoutOut::initialize(Parser &p)
_type = TO_OUT_DNS;
} else {
_type = TO_OUT_UNDEFINED;
- TSError("%s: unsupported timeout qualifier: %s", PLUGIN_NAME, p.get_arg().c_str());
+ TSError("[%s] unsupported timeout qualifier: %s", PLUGIN_NAME, p.get_arg().c_str());
}
_timeout.set_value(p.get_value());
@@ -389,7 +389,7 @@ OperatorSetTimeoutOut::exec(const Resources &res) const
TSHttpTxnDNSTimeoutSet(res.txnp, _timeout.get_int_value());
break;
default:
- TSError("%s: unsupported timeout", PLUGIN_NAME);
+ TSError("[%s] unsupported timeout", PLUGIN_NAME);
break;
}
}
@@ -543,7 +543,7 @@ OperatorCounter::initialize(Parser &p)
// Sanity
if (_counter_name.length() == 0) {
- TSError("%s: counter name is empty", PLUGIN_NAME);
+ TSError("[%s] counter name is empty", PLUGIN_NAME);
return;
}
@@ -551,7 +551,7 @@ OperatorCounter::initialize(Parser &p)
if (TSStatFindName(_counter_name.c_str(), &_counter) == TS_ERROR) {
_counter = TSStatCreate(_counter_name.c_str(), TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_COUNT);
if (_counter == TS_ERROR) {
- TSError("%s: TSStatCreate() failed. Can't create counter: %s", PLUGIN_NAME, _counter_name.c_str());
+ TSError("[%s] TSStatCreate() failed. Can't create counter: %s", PLUGIN_NAME, _counter_name.c_str());
return;
}
TSDebug(PLUGIN_NAME, "OperatorCounter::initialize(%s) created counter with id: %d", _counter_name.c_str(), _counter);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/parser.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc
index 4d3f8da..549e4f7 100644
--- a/plugins/header_rewrite/parser.cc
+++ b/plugins/header_rewrite/parser.cc
@@ -51,7 +51,7 @@ Parser::preprocess(std::vector<std::string> &tokens)
else
_arg = "";
} else {
- TSError("%s: conditions must be embraced in %%{}", PLUGIN_NAME);
+ TSError("[%s] conditions must be embraced in %%{}", PLUGIN_NAME);
return;
}
} else {
@@ -87,7 +87,7 @@ Parser::preprocess(std::vector<std::string> &tokens)
}
} else {
// Syntax error
- TSError("%s: mods have to be embraced in []", PLUGIN_NAME);
+ TSError("[%s] mods have to be embraced in []", PLUGIN_NAME);
return;
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/header_rewrite/ruleset.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/ruleset.cc b/plugins/header_rewrite/ruleset.cc
index 90a352e..b2c3bc7 100644
--- a/plugins/header_rewrite/ruleset.cc
+++ b/plugins/header_rewrite/ruleset.cc
@@ -50,7 +50,7 @@ RuleSet::add_condition(Parser &p)
TSDebug(PLUGIN_NAME, " Adding condition: %%{%s} with arg: %s\n", p.get_op().c_str(), p.get_arg().c_str());
c->initialize(p);
if (!c->set_hook(_hook)) {
- TSError("%s: can't use this condition in this hook", PLUGIN_NAME);
+ TSError("[%s] can't use this condition in this hook", PLUGIN_NAME);
return;
}
if (NULL == _cond) {
@@ -76,7 +76,7 @@ RuleSet::add_operator(Parser &p)
TSDebug(PLUGIN_NAME, " Adding operator: %s(%s)\n", p.get_op().c_str(), p.get_arg().c_str());
o->initialize(p);
if (!o->set_hook(_hook)) {
- TSError("%s: can't use this operator in this hook", PLUGIN_NAME);
+ TSError("[%s] can't use this operator in this hook", PLUGIN_NAME);
return;
}
if (NULL == _oper) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 113cefe..fd120da 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -334,7 +334,7 @@ RemapRegex::initialize(const std::string ®, const std::string &sub, const std
_lowercase_substitutions = true;
} else if (opt_val.size() <= 0) {
// All other options have a required value
- TSError("Malformed options: %s", opt.c_str());
+ TSError("[%s] Malformed options: %s", PLUGIN_NAME, opt.c_str());
break;
} else if (opt.compare(start, 6, "status") == 0) {
_status = static_cast<TSHttpStatus>(strtol(opt_val.c_str(), NULL, 10));
@@ -367,7 +367,7 @@ RemapRegex::initialize(const std::string ®, const std::string &sub, const std
cur->data_len = opt_val.size();
break;
default:
- TSError("%s: configuration variable '%s' is of an unsupported type", PLUGIN_NAME, opt_name.c_str());
+ TSError("[%s] configuration variable '%s' is of an unsupported type", PLUGIN_NAME, opt_name.c_str());
delete cur;
return false;
}
@@ -384,7 +384,7 @@ RemapRegex::initialize(const std::string ®, const std::string &sub, const std
last_override = cur;
}
} else {
- TSError("Unknown options: %s", opt.c_str());
+ TSError("[%s] Unknown options: %s", PLUGIN_NAME, opt.c_str());
}
}
start = opt.find_first_of("@", pos2);
@@ -717,12 +717,12 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
*ih = (void *)ri;
if (ri == NULL) {
- TSError("Unable to create remap instance");
+ TSError("[%s] Unable to create remap instance", PLUGIN_NAME);
return TS_ERROR;
}
if (argc < 3) {
- TSError("%s missing configuration file", PLUGIN_NAME);
+ TSError("[%s] missing configuration file", PLUGIN_NAME);
return TS_ERROR;
}
@@ -745,7 +745,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
} else if (strncmp(argv[i], "no-matrix-parameters", 18) == 0) {
ri->matrix_params = false;
} else {
- TSError("%s: invalid option '%s'", PLUGIN_NAME, argv[i]);
+ TSError("[%s] invalid option '%s'", PLUGIN_NAME, argv[i]);
}
}
@@ -760,13 +760,13 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
}
if (0 != access(ri->filename.c_str(), R_OK)) {
- TSError("%s: failed to access %s: %s", PLUGIN_NAME, ri->filename.c_str(), strerror(errno));
+ TSError("[%s] failed to access %s: %s", PLUGIN_NAME, ri->filename.c_str(), strerror(errno));
return TS_ERROR;
}
f.open((ri->filename).c_str(), std::ios::in);
if (!f.is_open()) {
- TSError("%s: unable to open %s", PLUGIN_NAME, (ri->filename).c_str());
+ TSError("[%s] unable to open %s", PLUGIN_NAME, (ri->filename).c_str());
return TS_ERROR;
}
TSDebug(PLUGIN_NAME, "Loading regular expressions from %s", (ri->filename).c_str());
@@ -809,12 +809,12 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
if (regex.empty()) {
// No regex found on this line
- TSError("no regexp found in %s: line %d", (ri->filename).c_str(), lineno);
+ TSError("[%s] no regexp found in %s: line %d", PLUGIN_NAME, (ri->filename).c_str(), lineno);
continue;
}
if (subst.empty() && options.empty()) {
// No substitution found on this line (and no options)
- TSError("no substitution string found in %s: line %d", (ri->filename).c_str(), lineno);
+ TSError("[%s] no substitution string found in %s: line %d", PLUGIN_NAME, (ri->filename).c_str(), lineno);
continue;
}
@@ -822,13 +822,13 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
RemapRegex *cur = new RemapRegex();
if (!cur->initialize(regex, subst, options)) {
- TSError("%s: can't create a new regex remap rule", PLUGIN_NAME);
+ TSError("[%s] can't create a new regex remap rule", PLUGIN_NAME);
delete cur;
continue;
}
if (cur->compile(&error, &erroffset) < 0) {
- TSError("%s: PCRE failed in %s (line %d) at offset %d: %s", PLUGIN_NAME, (ri->filename).c_str(), lineno, erroffset, error);
+ TSError("[%s] PCRE failed in %s (line %d) at offset %d: %s", PLUGIN_NAME, (ri->filename).c_str(), lineno, erroffset, error);
delete (cur);
} else {
TSDebug(PLUGIN_NAME, "Added regex=%s with subs=%s and options `%s'", regex.c_str(), subst.c_str(), options.c_str());
@@ -844,7 +844,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
// Make sure we got something...
if (ri->first == NULL) {
- TSError("%s: no regular expressions from the maps", PLUGIN_NAME);
+ TSError("[%s] no regular expressions from the maps", PLUGIN_NAME);
return TS_ERROR;
}
@@ -1059,7 +1059,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
// Setup the new URL
if (TS_PARSE_ERROR == TSUrlParse(rri->requestBufp, rri->requestUrl, &start, start + dest_len)) {
TSHttpTxnSetHttpRetStatus(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
- TSError("can't parse substituted URL string");
+ TSError("[%s] can't parse substituted URL string", PLUGIN_NAME);
}
}
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/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 828fc52..837398a 100644
--- a/plugins/stats_over_http/stats_over_http.c
+++ b/plugins/stats_over_http/stats_over_http.c
@@ -111,12 +111,12 @@ stats_process_read(TSCont contp, TSEvent event, stats_state *my_state)
TSVConnShutdown(my_state->net_vc, 1, 0);
my_state->write_vio = TSVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT64_MAX);
} else if (event == TS_EVENT_ERROR) {
- TSError("stats_process_read: Received TS_EVENT_ERROR\n");
+ TSError("[%s] stats_process_read: Received TS_EVENT_ERROR", PLUGIN_NAME);
} else if (event == TS_EVENT_VCONN_EOS) {
/* client may end the connection, simply return */
return;
} else if (event == TS_EVENT_NET_ACCEPT_FAILED) {
- TSError("stats_process_read: Received TS_EVENT_NET_ACCEPT_FAILED\n");
+ TSError("[%s] stats_process_read: Received TS_EVENT_NET_ACCEPT_FAILED", PLUGIN_NAME);
} else {
printf("Unexpected Event %d\n", event);
TSReleaseAssert(!"Unexpected Event");
@@ -208,7 +208,7 @@ stats_process_write(TSCont contp, TSEvent event, stats_state *my_state)
} else if (TS_EVENT_VCONN_WRITE_COMPLETE) {
stats_cleanup(contp, my_state);
} else if (event == TS_EVENT_ERROR) {
- TSError("stats_process_write: Received TS_EVENT_ERROR\n");
+ TSError("[%s] stats_process_write: Received TS_EVENT_ERROR", PLUGIN_NAME);
} else {
TSReleaseAssert(!"Unexpected Event");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 25b99da..83161af 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -2429,7 +2429,7 @@ test_url_print(TSMBuffer bufp, TSMLoc hdr_loc)
output_buffer = TSIOBufferCreate();
if (!output_buffer) {
- TSError("couldn't allocate IOBuffer\n");
+ TSError("[InkAPITest] couldn't allocate IOBuffer");
}
reader = TSIOBufferReaderAlloc(output_buffer);
@@ -4305,7 +4305,7 @@ convert_http_hdr_to_string(TSMBuffer bufp, TSMLoc hdr_loc)
output_buffer = TSIOBufferCreate();
if (!output_buffer) {
- TSError("couldn't allocate IOBuffer\n");
+ TSError("[InkAPITest] couldn't allocate IOBuffer");
}
reader = TSIOBufferReaderAlloc(output_buffer);
@@ -4513,7 +4513,7 @@ convert_mime_hdr_to_string(TSMBuffer bufp, TSMLoc hdr_loc)
output_buffer = TSIOBufferCreate();
if (!output_buffer) {
- TSError("couldn't allocate IOBuffer\n");
+ TSError("[InkAPITest] couldn't allocate IOBuffer");
}
reader = TSIOBufferReaderAlloc(output_buffer);
[2/3] trafficserver git commit: TS-2106 Added plugin names to all
TSError messages. Removed extraneous newlines. This closes #220.
Posted by am...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/background_fetch/background_fetch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/background_fetch/background_fetch.cc b/plugins/experimental/background_fetch/background_fetch.cc
index 2f10f43..d8438e4 100644
--- a/plugins/experimental/background_fetch/background_fetch.cc
+++ b/plugins/experimental/background_fetch/background_fetch.cc
@@ -141,7 +141,7 @@ struct BgFetchData {
TSMBufferDestroy(mbuf);
if (vc) {
- TSError("%s: Destroyed BgFetchDATA while VC was alive", PLUGIN_NAME);
+ TSError("[%s] Destroyed BgFetchDATA while VC was alive", PLUGIN_NAME);
TSVConnClose(vc);
vc = NULL;
}
@@ -226,10 +226,10 @@ BgFetchData::initialize(TSMBuffer request, TSMLoc req_hdr, TSHttpTxn txnp)
} else if (ip->sa_family == AF_INET6) {
memcpy(&client_ip, ip, sizeof(sockaddr_in6));
} else {
- TSError("%s: Unknown address family %d", PLUGIN_NAME, ip->sa_family);
+ TSError("[%s] Unknown address family %d", PLUGIN_NAME, ip->sa_family);
}
} else {
- TSError("%s: failed to get client host info", PLUGIN_NAME);
+ TSError("[%s] Failed to get client host info", PLUGIN_NAME);
return false;
}
@@ -355,7 +355,7 @@ cont_bg_fetch(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
TSDebug(PLUGIN_NAME, "Client IPv6 = %s", buf);
break;
default:
- TSError("%s: Unknown address family %d", PLUGIN_NAME, sockaddress->sa_family);
+ TSError("[%s] Unknown address family %d", PLUGIN_NAME, sockaddress->sa_family);
break;
}
TSDebug(PLUGIN_NAME, "Starting bg fetch on: %s", data->getUrl());
@@ -373,7 +373,7 @@ cont_bg_fetch(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
data->w_vio = TSVConnWrite(data->vc, contp, data->req_io_buf_reader, TSIOBufferReaderAvail(data->req_io_buf_reader));
} else {
delete data;
- TSError("%s: failed to connect to internal process, major malfunction", PLUGIN_NAME);
+ TSError("[%s] Failed to connect to internal process, major malfunction", PLUGIN_NAME);
}
break;
@@ -488,7 +488,7 @@ cont_handle_response(TSCont contp, TSEvent event, void *edata)
if (NULL == config) {
// something seriously wrong..
- TSError("%s: can't get configurations", PLUGIN_NAME);
+ TSError("[%s] Can't get configurations", PLUGIN_NAME);
} else {
switch (event) {
case TS_EVENT_HTTP_READ_RESPONSE_HDR:
@@ -517,7 +517,7 @@ cont_handle_response(TSCont contp, TSEvent event, void *edata)
config->release(); // Release the configuration lease when txn closes
break;
default:
- TSError("%s: unknown event for this plugin", PLUGIN_NAME);
+ TSError("[%s] Unknown event for this plugin", PLUGIN_NAME);
TSDebug(PLUGIN_NAME, "unknown event for this plugin");
break;
}
@@ -544,7 +544,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = (char *)"dev@trafficserver.apache.org";
if (TS_SUCCESS != TSPluginRegister(&info)) {
- TSError("%s: plugin registration failed.\n", PLUGIN_NAME);
+ TSError("[%s] Plugin registration failed.", PLUGIN_NAME);
}
TSCont cont = TSContCreate(cont_handle_response, NULL);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/background_fetch/configs.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/background_fetch/configs.cc b/plugins/experimental/background_fetch/configs.cc
index 0e77d66..c8aa7cc 100644
--- a/plugins/experimental/background_fetch/configs.cc
+++ b/plugins/experimental/background_fetch/configs.cc
@@ -33,7 +33,7 @@ BgFetchConfig::readConfig(const char *config_file)
TSFile file;
if (NULL == config_file) {
- TSError("%s: invalid config file", PLUGIN_NAME);
+ TSError("[%s] invalid config file", PLUGIN_NAME);
return false;
}
@@ -45,7 +45,7 @@ BgFetchConfig::readConfig(const char *config_file)
snprintf(file_path, sizeof(file_path), "%s/%s", TSInstallDirGet(), config_file);
file = TSfopen(file_path, "r");
if (NULL == file) {
- TSError("%s: invalid config file", PLUGIN_NAME);
+ TSError("[%s] invalid config file", PLUGIN_NAME);
return false;
}
}
@@ -59,7 +59,7 @@ BgFetchConfig::readConfig(const char *config_file)
// make sure line was not bigger than buffer
if (NULL == (eol = strchr(buffer, '\n')) && NULL == (eol = strstr(buffer, "\r\n"))) {
- TSError("%s: exclusion line too long, did not get a good line in cfg, skipping, line: %s", PLUGIN_NAME, buffer);
+ TSError("[%s] exclusion line too long, did not get a good line in cfg, skipping, line: %s", PLUGIN_NAME, buffer);
memset(buffer, 0, sizeof(buffer));
continue;
}
@@ -83,7 +83,7 @@ BgFetchConfig::readConfig(const char *config_file)
if (!strcmp(cfg_type, "exclude")) {
exclude = true;
} else if (strcmp(cfg_type, "include")) {
- TSError("%s: invalid specifier %s, skipping config line", PLUGIN_NAME, cfg_type);
+ TSError("[%s] invalid specifier %s, skipping config line", PLUGIN_NAME, cfg_type);
memset(buffer, 0, sizeof(buffer));
continue;
}
@@ -93,7 +93,7 @@ BgFetchConfig::readConfig(const char *config_file)
if (cfg_value) {
if (!strcmp(cfg_name, "Content-Length")) {
if ((cfg_value[0] != '<') && (cfg_value[0] != '>')) {
- TSError("%s: invalid content-len condition %s, skipping config value", PLUGIN_NAME, cfg_value);
+ TSError("[%s] invalid content-len condition %s, skipping config value", PLUGIN_NAME, cfg_value);
memset(buffer, 0, sizeof(buffer));
continue;
}
@@ -109,7 +109,7 @@ BgFetchConfig::readConfig(const char *config_file)
TSDebug(PLUGIN_NAME, "adding background_fetch exclusion rule %d for %s: %s", exclude, cfg_name, cfg_value);
} else {
- TSError("%s: invalid value %s, skipping config line", PLUGIN_NAME, cfg_name);
+ TSError("[%s] invalid value %s, skipping config line", PLUGIN_NAME, cfg_name);
}
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/background_fetch/rules.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/background_fetch/rules.cc b/plugins/experimental/background_fetch/rules.cc
index ad3cada..8f626eb 100644
--- a/plugins/experimental/background_fetch/rules.cc
+++ b/plugins/experimental/background_fetch/rules.cc
@@ -41,7 +41,7 @@ check_client_ip_configured(TSHttpTxn txnp, const char *cfg_ip)
} else if (AF_INET6 == client_ip->sa_family) {
inet_ntop(AF_INET6, &(reinterpret_cast<const sockaddr_in6 *>(client_ip)->sin6_addr), ip_buf, INET6_ADDRSTRLEN);
} else {
- TSError("%s: unknown family %d", PLUGIN_NAME, client_ip->sa_family);
+ TSError("[%s] Unknown family %d", PLUGIN_NAME, client_ip->sa_family);
return false;
}
@@ -65,7 +65,7 @@ check_content_length(const uint32_t len, const char *cfg_val)
} else if (cfg_val[0] == '>') {
return (len >= cfg_cont_len);
} else {
- TSError("%s: invalid content length condition %c", PLUGIN_NAME, cfg_val[0]);
+ TSError("[%s] Invalid content length condition %c", PLUGIN_NAME, cfg_val[0]);
return false;
}
}
@@ -110,7 +110,7 @@ check_field_configured(TSHttpTxn txnp, const char *field_name, const char *cfg_v
}
TSHandleMLocRelease(hdr_bufp, TS_NULL_MLOC, hdr_loc);
} else {
- TSError("%s: Failed to get resp headers", PLUGIN_NAME);
+ TSError("[%s] Failed to get resp headers", PLUGIN_NAME);
}
return hdr_found;
}
@@ -142,7 +142,7 @@ check_field_configured(TSHttpTxn txnp, const char *field_name, const char *cfg_v
}
TSHandleMLocRelease(hdr_bufp, TS_NULL_MLOC, hdr_loc);
} else {
- TSError("%s: Failed to get resp headers", PLUGIN_NAME);
+ TSError("[%s] Failed to get resp headers", PLUGIN_NAME);
}
return hdr_found;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index 3af676d..c330ec6 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -44,7 +44,7 @@ MakeBalancerInstance(const char *opt)
} else if (len == lengthof("roundrobin") && strncmp(opt, "roundrobin", len) == 0) {
return MakeRoundRobinBalancer(end ? end + 1 : NULL);
} else {
- TSError("balancer: invalid balancing policy '%.*s'", (int)len, opt);
+ TSError("[balancer] Invalid balancing policy '%.*s'", (int)len, opt);
return NULL;
}
}
@@ -82,7 +82,7 @@ MakeBalancerTarget(const char *strval)
}
if (target.port > INT16_MAX) {
- TSError("balancer: ignoring invalid port number for target '%s'", strval);
+ TSError("[balancer] Ignoring invalid port number for target '%s'", strval);
target.port = 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/balancer/hash.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/hash.cc b/plugins/experimental/balancer/hash.cc
index 11734b6..b24f22c 100644
--- a/plugins/experimental/balancer/hash.cc
+++ b/plugins/experimental/balancer/hash.cc
@@ -215,7 +215,7 @@ MakeHashBalancer(const char *options)
} else if (strcmp(opt, "dstaddr") == 0) {
hash->hash_parts.push_back(HashTxnDstaddr);
} else {
- TSError("balancer: ignoring invalid hash field '%s'", opt);
+ TSError("[balancer] Ignoring invalid hash field '%s'", opt);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/balancer/roundrobin.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/roundrobin.cc b/plugins/experimental/balancer/roundrobin.cc
index ab90921..aede787 100644
--- a/plugins/experimental/balancer/roundrobin.cc
+++ b/plugins/experimental/balancer/roundrobin.cc
@@ -63,7 +63,7 @@ MakeRoundRobinBalancer(const char *options)
if (options) {
options = tmp = strdup(options);
while ((opt = strsep(&tmp, ",")) != NULL) {
- TSError("balancer: ignoring invalid round robin field '%s'", opt);
+ TSError("[balancer] Ignoring invalid round robin field '%s'", opt);
}
free((void *)options);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/buffer_upload/buffer_upload.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/buffer_upload/buffer_upload.cc b/plugins/experimental/buffer_upload/buffer_upload.cc
index 014f288..a4daa17 100644
--- a/plugins/experimental/buffer_upload/buffer_upload.cc
+++ b/plugins/experimental/buffer_upload/buffer_upload.cc
@@ -51,7 +51,7 @@
//#define LOG_SET_FUNCTION_NAME(NAME) const char * FUNCTION_NAME = NAME
#define LOG_ERROR(API_NAME) \
{ \
- TSError("%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", __FUNCTION__, __FILE__, __LINE__); \
+ TSError("[%s] %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", __FUNCTION__, __FILE__, __LINE__); \
}
#define LOG_ERROR_AND_RETURN(API_NAME) \
{ \
@@ -936,17 +936,17 @@ create_directory()
struct dirent *d;
if (getcwd(cwd, 4096) == NULL) {
- TSError("getcwd fails");
+ TSError("[buffer_upload] getcwd fails");
return 0;
}
if (chdir(uconfig->base_dir) < 0) {
if (mkdir(uconfig->base_dir, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
- TSError("Unable to enter or create %s", uconfig->base_dir);
+ TSError("[buffer_upload] Unable to enter or create %s", uconfig->base_dir);
goto error_out;
}
if (chdir(uconfig->base_dir) < 0) {
- TSError("Unable enter %s", uconfig->base_dir);
+ TSError("[buffer_upload] Unable enter %s", uconfig->base_dir);
goto error_out;
}
}
@@ -954,11 +954,11 @@ create_directory()
snprintf(str, 10, "%02X", i);
if (chdir(str) < 0) {
if (mkdir(str, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
- TSError("Unable to enter or create %s/%s", uconfig->base_dir, str);
+ TSError("[buffer_upload] Unable to enter or create %s/%s", uconfig->base_dir, str);
goto error_out;
}
if (chdir(str) < 0) {
- TSError("Unable to enter %s/%s", uconfig->base_dir, str);
+ TSError("[buffer_upload] Unable to enter %s/%s", uconfig->base_dir, str);
goto error_out;
}
}
@@ -1003,7 +1003,7 @@ load_urls(char *filename)
for (i = 0; i < 2; i++) {
if ((file = TSfopen(filename, "r")) == NULL) {
TSfree(url_buf);
- TSError("Fail to open %s", filename);
+ TSError("[buffer_upload] Fail to open %s", filename);
return;
}
if (i == 0) { // first round
@@ -1052,7 +1052,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
int iv = strtol(tok, &end, 10);
if (end && *end == '\0') {
*((int *)cv->val) = iv;
- TSError("Parsed int config value %s : %d", cv->str, iv);
+ TSError("[buffer_upload] Parsed int config value %s : %d", cv->str, iv);
TSDebug(DEBUG_TAG, "Parsed int config value %s : %d", cv->str, iv);
}
break;
@@ -1062,7 +1062,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
unsigned int uiv = strtoul(tok, &end, 10);
if (end && *end == '\0') {
*((unsigned int *)cv->val) = uiv;
- TSError("Parsed uint config value %s : %u", cv->str, uiv);
+ TSError("[buffer_upload] Parsed uint config value %s : %u", cv->str, uiv);
TSDebug(DEBUG_TAG, "Parsed uint config value %s : %u", cv->str, uiv);
}
break;
@@ -1072,7 +1072,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
long lv = strtol(tok, &end, 10);
if (end && *end == '\0') {
*((long *)cv->val) = lv;
- TSError("Parsed long config value %s : %ld", cv->str, lv);
+ TSError("[buffer_upload] Parsed long config value %s : %ld", cv->str, lv);
TSDebug(DEBUG_TAG, "Parsed long config value %s : %ld", cv->str, lv);
}
break;
@@ -1082,7 +1082,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
unsigned long ulv = strtoul(tok, &end, 10);
if (end && *end == '\0') {
*((unsigned long *)cv->val) = ulv;
- TSError("Parsed ulong config value %s : %lu", cv->str, ulv);
+ TSError("[buffer_upload] Parsed ulong config value %s : %lu", cv->str, ulv);
TSDebug(DEBUG_TAG, "Parsed ulong config value %s : %lu", cv->str, ulv);
}
break;
@@ -1092,7 +1092,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
if (len > 0) {
*((char **)cv->val) = (char *)TSmalloc(len + 1);
strcpy(*((char **)cv->val), tok);
- TSError("Parsed string config value %s : %s", cv->str, tok);
+ TSError("[buffer_upload] Parsed string config value %s : %s", cv->str, tok);
TSDebug(DEBUG_TAG, "Parsed string config value %s : %s", cv->str, tok);
}
break;
@@ -1104,7 +1104,7 @@ parse_config_line(char *line, const struct config_val_ul *cv)
*((bool *)cv->val) = true;
else
*((bool *)cv->val) = false;
- TSError("Parsed bool config value %s : %d", cv->str, *((bool *)cv->val));
+ TSError("[buffer_upload] Parsed bool config value %s : %d", cv->str, *((bool *)cv->val));
TSDebug(DEBUG_TAG, "Parsed bool config value %s : %d", cv->str, *((bool *)cv->val));
}
break;
@@ -1158,7 +1158,7 @@ read_upload_config(const char *file_name)
}
TSfclose(conf_file);
} else {
- TSError("Failed to open upload config file %s", file_name);
+ TSError("[buffer_upload] Failed to open upload config file %s", file_name);
// if fail to open config file, use the default config
}
@@ -1201,15 +1201,15 @@ TSPluginInit(int argc, const char *argv[])
if (!read_upload_config(conf_filename) || !uconfig) {
if (argc > 1) {
- TSError("Failed to read upload config %s\n", argv[1]);
+ TSError("[buffer_upload] Failed to read upload config %s", argv[1]);
} else {
- TSError("No config file specified. Specify conf file in plugin.conf: "
- "'buffer_upload.so /path/to/upload.conf'\n");
+ TSError("[buffer_upload] No config file specified. Specify conf file in plugin.conf: "
+ "'buffer_upload.so /path/to/upload.conf'");
}
}
// set the num of threads for disk AIO
if (TSAIOThreadNumSet(uconfig->thread_num) == TS_ERROR) {
- TSError("Failed to set thread number.");
+ TSError("[buffer_upload] Failed to set thread number.");
}
TSDebug(DEBUG_TAG, "uconfig->url_list_file: %s", uconfig->url_list_file);
@@ -1223,12 +1223,12 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = const_cast<char *>("dev@trafficserver.apache.org");
if (uconfig->use_disk_buffer && !create_directory()) {
- TSError("Directory creation failed.");
+ TSError("[buffer_upload] Directory creation failed.");
uconfig->use_disk_buffer = 0;
}
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.");
+ TSError("[buffer_upload] Plugin registration failed.");
}
/* create the statistic variables */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/cache_promote/cache_promote.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/cache_promote/cache_promote.cc b/plugins/experimental/cache_promote/cache_promote.cc
index a7be269..f7d18c3 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -124,7 +124,7 @@ public:
void
usage() const
{
- TSError(PLUGIN_NAME, "Usage: @plugin=%s.so @pparam=--policy=chance @pparam=--sample=<x>%", PLUGIN_NAME);
+ TSError("[cache_promote] Usage: @plugin=%s.so @pparam=--policy=chance @pparam=--sample=<x>%");
}
const char *
@@ -285,7 +285,7 @@ public:
void
usage() const
{
- TSError(PLUGIN_NAME, "Usage: @plugin=%s.so @pparam=--policy=lru @pparam=--buckets=<n> --hits=<m> --sample=<x>", PLUGIN_NAME);
+ TSError("[cache_promote] Usage: @plugin=%s.so @pparam=--policy=lru @pparam=--buckets=<n> --hits=<m> --sample=<x>");
}
const char *
@@ -336,7 +336,7 @@ public:
} else if (0 == strncasecmp(optarg, "lru", 3)) {
_policy = new LRUPolicy();
} else {
- TSError("Unknown policy --policy=%s", optarg);
+ TSError("[cache_promote] Unknown policy --policy=%s", optarg);
return false;
}
if (_policy) {
@@ -349,14 +349,14 @@ public:
_policy->setSample(optarg);
} else {
if (!_policy->parseOption(opt, optarg)) {
- TSError("The specified policy (%s) does not support the -%c option", _policy->policyName(), opt);
+ TSError("[cache_promote] The specified policy (%s) does not support the -%c option", _policy->policyName(), opt);
delete _policy;
_policy = NULL;
return false;
}
}
} else {
- TSError("The --policy=<n> parameter must come first on the remap configuration");
+ TSError("[cache_promote] The --policy=<n> parameter must come first on the remap configuration");
return false;
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/cache_range_requests/cache_range_requests.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/cache_range_requests/cache_range_requests.cc b/plugins/experimental/cache_range_requests/cache_range_requests.cc
index 0eeb376..ddaa61e 100644
--- a/plugins/experimental/cache_range_requests/cache_range_requests.cc
+++ b/plugins/experimental/cache_range_requests/cache_range_requests.cc
@@ -374,8 +374,8 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = (char *)"John_Rushford@cable.comcast.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[%s] TSPluginInit(): Plugin registration failed.\n", PLUGIN_NAME);
- TSError("[%s] Unable to initialize plugin (disabled).\n", PLUGIN_NAME);
+ TSError("[%s] TSPluginInit(): Plugin registration failed.", PLUGIN_NAME);
+ TSError("[%s] Unable to initialize plugin (disabled).", PLUGIN_NAME);
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/collapsed_connection/collapsed_connection.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/collapsed_connection/collapsed_connection.cc b/plugins/experimental/collapsed_connection/collapsed_connection.cc
index ad35b21..7161359 100644
--- a/plugins/experimental/collapsed_connection/collapsed_connection.cc
+++ b/plugins/experimental/collapsed_connection/collapsed_connection.cc
@@ -152,7 +152,7 @@ initConfig(const char *fn)
} else if (0 == strcmp("1", fn)) {
config->enabled = true;
} else {
- TSError("parameter '%s' ignored", fn);
+ TSError("[collapsed_connection] Parameter '%s' ignored", fn);
}
} else {
int line_num = 0;
@@ -162,7 +162,7 @@ initConfig(const char *fn)
TSRecordDataType type, expected_type;
if (NULL == (file = TSfopen(fn, "r"))) {
- TSError("could not open config file %s", fn);
+ TSError("[collapsed_connection] Could not open config file %s", fn);
} else {
while (NULL != TSfgets(file, buf, sizeof(buf))) {
char *ln, *tok;
@@ -178,24 +178,24 @@ initConfig(const char *fn)
continue;
if (strncmp(tok, "CONFIG", 6)) {
- TSError("file %s, line %d: non-CONFIG line encountered", fn, line_num);
+ TSError("[collapsed_connection] File %s, line %d: non-CONFIG line encountered", fn, line_num);
continue;
}
// Find the configuration name
tok = strtok_r(NULL, " \t", &ln);
if (CcHttpTxnConfigFind(tok, -1, &name, &expected_type) != TS_SUCCESS) {
- TSError("file %s, line %d: no records.config name given", fn, line_num);
+ TSError("[collapsed_connection] File %s, line %d: no records.config name given", fn, line_num);
continue;
}
// Find the type (INT or STRING only)
tok = strtok_r(NULL, " \t", &ln);
if (TS_RECORDDATATYPE_NULL == (type = str_to_datatype(tok))) {
- TSError("file %s, line %d: only INT and STRING types supported", fn, line_num);
+ TSError("[collapsed_connection] File %s, line %d: only INT and STRING types supported", fn, line_num);
continue;
}
if (type != expected_type) {
- TSError("file %s, line %d: mismatch between provide data type, and expected type", fn, line_num);
+ TSError("[collapsed_connection] File %s, line %d: mismatch between provide data type, and expected type", fn, line_num);
continue;
}
// Find the value (which depends on the type above)
@@ -218,7 +218,7 @@ initConfig(const char *fn)
tok = NULL;
}
if (!tok) {
- TSError("file %s, line %d: the configuration must provide a value", fn, line_num);
+ TSError("[collapsed_connection] File %s, line %d: the configuration must provide a value", fn, line_num);
continue;
}
// Now store the new config
@@ -1114,17 +1114,17 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = const_cast<char *>(PLUGIN_SUPPORT);
if (TS_SUCCESS != TSPluginRegister(&info)) {
- TSError("Plugin registration failed");
+ TSError("[collapsed_connection] Plugin registration failed");
return;
}
if (TS_SUCCESS != TSMgmtIntGet("proxy.config.http.cache.http", &http_cache) || 0 == http_cache) {
- TSError("Http cache is disabled, plugin would not work");
+ TSError("[collapsed_connection] Http cache is disabled, plugin would not work");
return;
}
if (!(contp = TSContCreate(collapsedConnectionMainHandler, NULL))) {
- TSError("Could not create continuation");
+ TSError("[collapsed_connection] Could not create continuation");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/custom_redirect/custom_redirect.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/custom_redirect/custom_redirect.cc b/plugins/experimental/custom_redirect/custom_redirect.cc
index 7f657d2..024f736 100644
--- a/plugins/experimental/custom_redirect/custom_redirect.cc
+++ b/plugins/experimental/custom_redirect/custom_redirect.cc
@@ -51,13 +51,13 @@ handle_response(TSHttpTxn txnp, TSCont /* contp ATS_UNUSED */)
int redirect_url_length;
if (TSHttpTxnServerRespGet(txnp, &resp_bufp, &resp_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve server response header\n");
+ TSError("[custom_redirect] Couldn't retrieve server response header");
} else {
if ((status = TSHttpHdrStatusGet(resp_bufp, resp_loc)) == TS_HTTP_STATUS_NONE) {
- TSError("couldn't retrieve status from client response header\n");
+ TSError("[custom_redirect] Couldn't retrieve status from client response header");
} else {
if (TSHttpTxnClientReqGet(txnp, &req_bufp, &req_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve server response header\n");
+ TSError("[custom_redirect] Couldn't retrieve server response header");
} else {
int method_len;
const char *method = TSHttpHdrMethodGet(req_bufp, req_loc, &method_len);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/epic/epic.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/epic/epic.cc b/plugins/experimental/epic/epic.cc
index 0551454..06fe108 100644
--- a/plugins/experimental/epic/epic.cc
+++ b/plugins/experimental/epic/epic.cc
@@ -43,7 +43,7 @@
#if defined(DEBUG)
#define error(fmt, ...) debug(fmt, ##__VA_ARGS__)
#else
-#define error(fmt, ...) TSError("epic:%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
+#define error(fmt, ...) TSError("[epic]%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
#endif
static TSHRTime epic_period;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/esi/esi.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/esi.cc b/plugins/experimental/esi/esi.cc
index ff3a428..610fa78 100644
--- a/plugins/experimental/esi/esi.cc
+++ b/plugins/experimental/esi/esi.cc
@@ -198,7 +198,7 @@ bool
ContData::init()
{
if (initialized) {
- TSError("[%s] ContData already initialized!", __FUNCTION__);
+ TSError("[esi][%s] ContData already initialized!", __FUNCTION__);
return false;
}
@@ -214,7 +214,7 @@ ContData::init()
// Get upstream VIO
input_vio = TSVConnWriteVIOGet(contp);
if (!input_vio) {
- TSError("[%s] Error while getting input vio", __FUNCTION__);
+ TSError("[esi][%s] Error while getting input vio", __FUNCTION__);
goto lReturn;
}
input_reader = TSVIOReaderGet(input_vio);
@@ -223,7 +223,7 @@ ContData::init()
TSVConn output_conn;
output_conn = TSTransformOutputVConnGet(contp);
if (!output_conn) {
- TSError("[%s] Error while getting transform VC", __FUNCTION__);
+ TSError("[esi][%s] Error while getting transform VC", __FUNCTION__);
goto lReturn;
}
output_buffer = TSIOBufferCreate();
@@ -265,7 +265,7 @@ ContData::getClientState()
TSMBuffer req_bufp;
TSMLoc req_hdr_loc;
if (TSHttpTxnClientReqGet(txnp, &req_bufp, &req_hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Error while retrieving client request", __FUNCTION__);
+ TSError("[esi][%s] Error while retrieving client request", __FUNCTION__);
return;
}
@@ -281,7 +281,7 @@ ContData::getClientState()
TSMBuffer bufp;
TSMLoc url_loc;
if (TSHttpTxnPristineUrlGet(txnp, &bufp, &url_loc) != TS_SUCCESS) {
- TSError("[%s] Error while retrieving hdr url", __FUNCTION__);
+ TSError("[esi][%s] Error while retrieving hdr url", __FUNCTION__);
return;
}
if (url_loc) {
@@ -437,12 +437,12 @@ ContData::getServerState()
input_type = DATA_TYPE_PACKED_ESI;
return;
} else if (TSHttpTxnCachedRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
+ TSError("[esi][%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
input_type = DATA_TYPE_RAW_ESI;
return;
}
} else if (TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
+ TSError("[esi][%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
input_type = DATA_TYPE_RAW_ESI;
return;
}
@@ -510,36 +510,36 @@ removeCacheKey(TSHttpTxn txnp)
bool result = false;
if (TSHttpTxnClientReqGet(txnp, &req_bufp, &req_hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Error while retrieving client request", __FUNCTION__);
+ TSError("[esi][%s] Error while retrieving client request", __FUNCTION__);
return false;
}
do {
if (TSHttpTxnPristineUrlGet(txnp, &req_bufp, &url_loc) != TS_SUCCESS) {
- TSError("[%s] Error while retrieving hdr url", __FUNCTION__);
+ TSError("[esi][%s] Error while retrieving hdr url", __FUNCTION__);
break;
}
contp = TSContCreate(removeCacheHandler, NULL);
if (contp == NULL) {
- TSError("[%s] Could not create continuation", __FUNCTION__);
+ TSError("[esi][%s] Could not create continuation", __FUNCTION__);
break;
}
cacheKey = TSCacheKeyCreate();
if (cacheKey == NULL) {
- TSError("[%s] TSCacheKeyCreate fail", __FUNCTION__);
+ TSError("[esi][%s] TSCacheKeyCreate fail", __FUNCTION__);
break;
}
if (TSCacheKeyDigestFromUrlSet(cacheKey, url_loc) != TS_SUCCESS) {
- TSError("[%s] TSCacheKeyDigestFromUrlSet fail", __FUNCTION__);
+ TSError("[esi][%s] TSCacheKeyDigestFromUrlSet fail", __FUNCTION__);
break;
}
TSCacheRemove(contp, cacheKey);
result = true;
- TSError("[%s] TSCacheRemoved", __FUNCTION__);
+ TSError("[esi][%s] TSCacheRemoved", __FUNCTION__);
} while (0);
if (cacheKey != NULL) {
@@ -645,7 +645,7 @@ transformData(TSCont contp)
if (toread > 0) {
avail = TSIOBufferReaderAvail(cont_data->input_reader);
if (avail == TS_ERROR) {
- TSError("[%s] Error while getting number of bytes available", __FUNCTION__);
+ TSError("[esi][%s] Error while getting number of bytes available", __FUNCTION__);
return 0;
}
@@ -742,7 +742,7 @@ transformData(TSCont contp)
TSDebug(cont_data->debug_tag, "[%s] ESI processor output document of size %d starting with [%.10s]", __FUNCTION__,
out_data_len, (out_data_len ? out_data : "(null)"));
} else {
- TSError("[%s] ESI processor failed to process document; will return empty document", __FUNCTION__);
+ TSError("[esi][%s] ESI processor failed to process document; will return empty document", __FUNCTION__);
out_data = "";
out_data_len = 0;
}
@@ -752,7 +752,7 @@ transformData(TSCont contp)
string cdata;
if (cont_data->gzip_output) {
if (!gzip(out_data, out_data_len, cdata)) {
- TSError("[%s] Error while gzipping content", __FUNCTION__);
+ TSError("[esi][%s] Error while gzipping content", __FUNCTION__);
out_data_len = 0;
out_data = "";
} else {
@@ -767,7 +767,7 @@ transformData(TSCont contp)
TSVConn output_conn;
output_conn = TSTransformOutputVConnGet(contp);
if (!output_conn) {
- TSError("[%s] Error while getting transform VC", __FUNCTION__);
+ TSError("[esi][%s] Error while getting transform VC", __FUNCTION__);
return 0;
}
@@ -775,7 +775,7 @@ transformData(TSCont contp)
output_vio = TSVConnWrite(output_conn, contp, cont_data->output_reader, out_data_len);
if (TSIOBufferWrite(TSVIOBufferGet(output_vio), out_data, out_data_len) == TS_ERROR) {
- TSError("[%s] Error while writing bytes to downstream VC", __FUNCTION__);
+ TSError("[esi][%s] Error while writing bytes to downstream VC", __FUNCTION__);
return 0;
}
@@ -806,7 +806,7 @@ transformData(TSCont contp)
TSDebug(cont_data->debug_tag, "[%s] ESI processor output document of size %d starting with [%.10s]", __FUNCTION__,
(int)out_data.size(), (out_data.size() ? out_data.data() : "(null)"));
} else {
- TSError("[%s] ESI processor failed to process document; will return empty document", __FUNCTION__);
+ TSError("[esi][%s] ESI processor failed to process document; will return empty document", __FUNCTION__);
out_data.assign("");
if (!cont_data->xform_closed) {
@@ -819,7 +819,7 @@ transformData(TSCont contp)
if (!cont_data->xform_closed && out_data.size() > 0) {
if (cont_data->gzip_output) {
if (!cont_data->esi_gzip->stream_encode(out_data, cdata)) {
- TSError("[%s] Error while gzipping content", __FUNCTION__);
+ TSError("[esi][%s] Error while gzipping content", __FUNCTION__);
} else {
TSDebug(cont_data->debug_tag, "[%s] Compressed document from size %d to %d bytes", __FUNCTION__, (int)out_data.size(),
(int)cdata.size());
@@ -828,12 +828,12 @@ transformData(TSCont contp)
if (cont_data->gzip_output) {
if (TSIOBufferWrite(TSVIOBufferGet(cont_data->output_vio), cdata.data(), cdata.size()) == TS_ERROR) {
- TSError("[%s] Error while writing bytes to downstream VC", __FUNCTION__);
+ TSError("[esi][%s] Error while writing bytes to downstream VC", __FUNCTION__);
return 0;
}
} else {
if (TSIOBufferWrite(TSVIOBufferGet(cont_data->output_vio), out_data.data(), out_data.size()) == TS_ERROR) {
- TSError("[%s] Error while writing bytes to downstream VC", __FUNCTION__);
+ TSError("[esi][%s] Error while writing bytes to downstream VC", __FUNCTION__);
return 0;
}
}
@@ -845,15 +845,15 @@ transformData(TSCont contp)
string cdata;
int downstream_length;
if (!cont_data->esi_gzip->stream_finish(cdata, downstream_length)) {
- TSError("[%s] Error while finishing gzip", __FUNCTION__);
+ TSError("[esi][%s] Error while finishing gzip", __FUNCTION__);
return 0;
} else {
if (TSVIOBufferGet(cont_data->output_vio) == NULL) {
- TSError("[%s] Error while writing bytes to downstream VC", __FUNCTION__);
+ TSError("[esi][%s] Error while writing bytes to downstream VC", __FUNCTION__);
return 0;
}
if (TSIOBufferWrite(TSVIOBufferGet(cont_data->output_vio), cdata.data(), cdata.size()) == TS_ERROR) {
- TSError("[%s] Error while writing bytes to downstream VC", __FUNCTION__);
+ TSError("[esi][%s] Error while writing bytes to downstream VC", __FUNCTION__);
return 0;
}
TSDebug(cont_data->debug_tag, "[%s] ESI processed overall/gzip: %d", __FUNCTION__, downstream_length);
@@ -887,7 +887,7 @@ transformHandler(TSCont contp, TSEvent event, void *edata)
if (!cont_data->initialized) {
if (!cont_data->init()) {
- TSError("[%s] Could not initialize continuation data; shutting down transformation", __FUNCTION__);
+ TSError("[esi][%s] Could not initialize continuation data; shutting down transformation", __FUNCTION__);
goto lShutdown;
}
TSDebug(cont_data->debug_tag, "[%s] initialized continuation data", __FUNCTION__);
@@ -935,7 +935,7 @@ transformHandler(TSCont contp, TSEvent event, void *edata)
// doubt: what is this code doing?
input_vio = TSVConnWriteVIOGet(contp);
if (!input_vio) {
- TSError("[%s] Error while getting upstream vio", __FUNCTION__);
+ TSError("[esi][%s] Error while getting upstream vio", __FUNCTION__);
} else {
TSContCall(TSVIOContGet(input_vio), TS_EVENT_ERROR, input_vio);
}
@@ -974,7 +974,7 @@ transformHandler(TSCont contp, TSEvent event, void *edata)
}
}
} else {
- TSError("[%s] Could not handle fetch event!", __FUNCTION__);
+ TSError("[esi][%s] Could not handle fetch event!", __FUNCTION__);
}
} else {
TSAssert(!"Unexpected event");
@@ -1021,17 +1021,17 @@ addMimeHeaderField(TSMBuffer bufp, TSMLoc hdr_loc, const char *name, int name_le
TSMLoc field_loc = (TSMLoc)NULL;
TSMimeHdrFieldCreate(bufp, hdr_loc, &field_loc);
if (!field_loc) {
- TSError("[%s] Error while creating mime field", __FUNCTION__);
+ TSError("[esi][%s] Error while creating mime field", __FUNCTION__);
} else {
if (TSMimeHdrFieldNameSet(bufp, hdr_loc, field_loc, name, name_len) != TS_SUCCESS) {
- TSError("[%s] Error while setting name [%.*s] for MIME header field", __FUNCTION__, name_len, name);
+ TSError("[esi][%s] Error while setting name [%.*s] for MIME header field", __FUNCTION__, name_len, name);
} else {
if (TSMimeHdrFieldValueStringInsert(bufp, hdr_loc, field_loc, 0, value, value_len) != TS_SUCCESS) {
- TSError("[%s] Error while inserting value [%.*s] string to MIME field [%.*s]", __FUNCTION__, value_len, value, name_len,
+ TSError("[esi][%s] Error while inserting value [%.*s] string to MIME field [%.*s]", __FUNCTION__, value_len, value, name_len,
name);
} else {
if (TSMimeHdrFieldAppend(bufp, hdr_loc, field_loc) != TS_SUCCESS) {
- TSError("[%s] Error while appending MIME field with name [%.*s] and value [%.*s]", __FUNCTION__, name_len, name,
+ TSError("[esi][%s] Error while appending MIME field with name [%.*s] and value [%.*s]", __FUNCTION__, name_len, name,
value_len, value);
}
}
@@ -1047,7 +1047,7 @@ modifyResponseHeader(TSCont contp, TSEvent event, void *edata)
RespHdrModData *mod_data = static_cast<RespHdrModData *>(TSContDataGet(contp));
TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
if (event != TS_EVENT_HTTP_SEND_RESPONSE_HDR) {
- TSError("[%s] Unexpected event (%d)", __FUNCTION__, event);
+ TSError("[esi][%s] Unexpected event (%d)", __FUNCTION__, event);
goto lReturn;
}
TSMBuffer bufp;
@@ -1082,7 +1082,7 @@ modifyResponseHeader(TSCont contp, TSEvent event, void *edata)
} else if (Utils::areEqual(name, name_len, TS_MIME_FIELD_CONTENT_LENGTH, TS_MIME_LEN_CONTENT_LENGTH)) {
if (mod_data->head_only) {
destroy_header = true;
- TSError("[%s] remove Content-Length", __FUNCTION__);
+ TSError("[esi][%s] remove Content-Length", __FUNCTION__);
}
} else {
int n_field_values = TSMimeHdrFieldValuesCount(bufp, hdr_loc, field_loc);
@@ -1133,7 +1133,7 @@ modifyResponseHeader(TSCont contp, TSEvent event, void *edata)
TSDebug(DEBUG_TAG, "[%s] Inspected client-bound headers", __FUNCTION__);
retval = 1;
} else {
- TSError("[%s] Error while getting response from txn", __FUNCTION__);
+ TSError("[esi][%s] Error while getting response from txn", __FUNCTION__);
}
lReturn:
@@ -1186,7 +1186,7 @@ maskOsCacheHeaders(TSHttpTxn txnp)
TSMBuffer bufp;
TSMLoc hdr_loc;
if (TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Couldn't get server response from txn", __FUNCTION__);
+ TSError("[esi][%s] Couldn't get server response from txn", __FUNCTION__);
return;
}
int n_mime_headers = TSMimeHdrFieldsCount(bufp, hdr_loc);
@@ -1226,7 +1226,7 @@ maskOsCacheHeaders(TSHttpTxn txnp)
masked_name.assign(HEADER_MASK_PREFIX);
masked_name.append(name, name_len);
if (TSMimeHdrFieldNameSet(bufp, hdr_loc, field_loc, masked_name.data(), masked_name.size()) != TS_SUCCESS) {
- TSError("[%s] Couldn't rename header [%.*s]", __FUNCTION__, name_len, name);
+ TSError("[esi][%s] Couldn't rename header [%.*s]", __FUNCTION__, name_len, name);
}
}
} // end if got header name
@@ -1250,7 +1250,7 @@ isTxnTransformable(TSHttpTxn txnp, bool is_cache_txn, bool *intercept_header, bo
bool retval = false;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Couldn't get txn header", __FUNCTION__);
+ TSError("[esi][%s] Couldn't get txn header", __FUNCTION__);
return false;
}
@@ -1258,7 +1258,7 @@ isTxnTransformable(TSHttpTxn txnp, bool is_cache_txn, bool *intercept_header, bo
const char *method;
method = TSHttpHdrMethodGet(bufp, hdr_loc, &method_len);
if (method == NULL) {
- TSError("[%s] Couldn't get method", __FUNCTION__);
+ TSError("[esi][%s] Couldn't get method", __FUNCTION__);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
return false;
}
@@ -1275,7 +1275,7 @@ isTxnTransformable(TSHttpTxn txnp, bool is_cache_txn, bool *intercept_header, bo
header_obtained = is_cache_txn ? TSHttpTxnCachedRespGet(txnp, &bufp, &hdr_loc) : TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc);
if (header_obtained != TS_SUCCESS) {
- TSError("[%s] Couldn't get txn header", __FUNCTION__);
+ TSError("[esi][%s] Couldn't get txn header", __FUNCTION__);
return false;
}
@@ -1318,7 +1318,7 @@ isCacheObjTransformable(TSHttpTxn txnp, bool *intercept_header, bool *head_only)
{
int obj_status;
if (TSHttpTxnCacheLookupStatusGet(txnp, &obj_status) == TS_ERROR) {
- TSError("[%s] Couldn't get cache status of object", __FUNCTION__);
+ TSError("[esi][%s] Couldn't get cache status of object", __FUNCTION__);
return false;
}
if (obj_status == TS_CACHE_LOOKUP_HIT_FRESH) {
@@ -1347,7 +1347,7 @@ isInterceptRequest(TSHttpTxn txnp)
TSMBuffer bufp;
TSMLoc hdr_loc;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[%s] Could not get client request", __FUNCTION__);
+ TSError("[esi][%s] Could not get client request", __FUNCTION__);
return false;
}
@@ -1356,7 +1356,7 @@ isInterceptRequest(TSHttpTxn txnp)
int method_len;
const char *method = TSHttpHdrMethodGet(bufp, hdr_loc, &method_len);
if (!method) {
- TSError("[%s] Could not obtain method!", __FUNCTION__);
+ TSError("[esi][%s] Could not obtain method!", __FUNCTION__);
} else {
if ((method_len != TS_HTTP_LEN_POST) || (strncasecmp(method, TS_HTTP_METHOD_POST, TS_HTTP_LEN_POST))) {
TSDebug(DEBUG_TAG, "[%s] Method [%.*s] invalid, [%s] expected", __FUNCTION__, method_len, method, TS_HTTP_METHOD_POST);
@@ -1399,7 +1399,7 @@ addSendResponseHeaderHook(TSHttpTxn txnp, const ContData *src_cont_data)
{
TSCont contp = TSContCreate(modifyResponseHeader, NULL);
if (!contp) {
- TSError("[%s] Could not create continuation", __FUNCTION__);
+ TSError("[esi][%s] Could not create continuation", __FUNCTION__);
return false;
}
TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
@@ -1421,7 +1421,7 @@ addTransform(TSHttpTxn txnp, const bool processing_os_response, const bool inter
contp = TSTransformCreate(transformHandler, txnp);
if (!contp) {
- TSError("[%s] Error while creating a new transformation", __FUNCTION__);
+ TSError("[esi][%s] Error while creating a new transformation", __FUNCTION__);
goto lFail;
}
@@ -1450,7 +1450,7 @@ addTransform(TSHttpTxn txnp, const bool processing_os_response, const bool inter
TSHttpTxnHookAdd(txnp, TS_HTTP_RESPONSE_TRANSFORM_HOOK, contp);
if (!addSendResponseHeaderHook(txnp, cont_data)) {
- TSError("[%s] Couldn't add send response header hook", __FUNCTION__);
+ TSError("[esi][%s] Couldn't add send response header hook", __FUNCTION__);
goto lFail;
}
@@ -1489,7 +1489,7 @@ globalHookHandler(TSCont contp, TSEvent event, void *edata)
TSDebug(DEBUG_TAG, "[%s] handling read request header event...", __FUNCTION__);
if (intercept_req) {
if (!setupServerIntercept(txnp)) {
- TSError("[%s] Could not setup server intercept", __FUNCTION__);
+ TSError("[esi][%s] Could not setup server intercept", __FUNCTION__);
} else {
TSDebug(DEBUG_TAG, "[%s] Setup server intercept", __FUNCTION__);
}
@@ -1557,7 +1557,7 @@ loadHandlerConf(const char *file_name, Utils::KeyValueMap &handler_conf)
Utils::parseKeyValueConfig(conf_lines, handler_conf);
TSDebug(DEBUG_TAG, "[%s] Loaded handler conf file [%s]", __FUNCTION__, file_name);
} else {
- TSError("[%s] Failed to open handler config file [%s]", __FUNCTION__, file_name);
+ TSError("[esi][%s] Failed to open handler config file [%s]", __FUNCTION__, file_name);
}
}
@@ -1621,7 +1621,7 @@ esiPluginInit(int argc, const char *argv[], struct OptionInfo *pOptionInfo)
if (threadKey == 0) {
bKeySet = true;
if ((result = pthread_key_create(&threadKey, NULL)) != 0) {
- TSError("[%s] Could not create key", __FUNCTION__);
+ TSError("[esi][%s] Could not create key", __FUNCTION__);
TSDebug(DEBUG_TAG, "[%s] Could not create key", __FUNCTION__);
}
} else {
@@ -1644,7 +1644,7 @@ TSPluginInit(int argc, const char *argv[])
{
struct OptionInfo *pOptionInfo = (struct OptionInfo *)TSmalloc(sizeof(struct OptionInfo));
if (pOptionInfo == NULL) {
- TSError("[%s] malloc %d bytes fail", __FUNCTION__, (int)sizeof(struct OptionInfo));
+ TSError("[esi][%s] malloc %d bytes fail", __FUNCTION__, (int)sizeof(struct OptionInfo));
return;
}
if (esiPluginInit(argc, argv, pOptionInfo) != 0) {
@@ -1654,7 +1654,7 @@ TSPluginInit(int argc, const char *argv[])
TSCont global_contp = TSContCreate(globalHookHandler, NULL);
if (!global_contp) {
- TSError("[%s] Could not create global continuation", __FUNCTION__);
+ TSError("[esi][%s] Could not create global continuation", __FUNCTION__);
TSfree(pOptionInfo);
return;
}
@@ -1673,13 +1673,13 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
{
if (!api_info) {
snprintf(errbuf, errbuf_size, "[TSRemapInit] - Invalid TSRemapInterface argument");
- TSError("[TSRemapInit] - Invalid TSRemapInterface argument");
+ TSError("[esi][TSRemapInit] - Invalid TSRemapInterface argument");
return TS_ERROR;
}
if (api_info->size < sizeof(TSRemapInterface)) {
snprintf(errbuf, errbuf_size, "[TSRemapInit] - Incorrect size of TSRemapInterface structure");
- TSError("[TSRemapInit] - Incorrect size of TSRemapInterface structure");
+ TSError("[esi][TSRemapInit] - Incorrect size of TSRemapInterface structure");
return TS_ERROR;
}
@@ -1694,7 +1694,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
snprintf(errbuf, errbuf_size, "Unable to create remap instance, "
"argc: %d < 2",
argc);
- TSError("Unable to create remap instance! argc: %d < 2", argc);
+ TSError("[esi]Unable to create remap instance! argc: %d < 2", argc);
return TS_ERROR;
}
@@ -1710,7 +1710,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
struct OptionInfo *pOptionInfo = (struct OptionInfo *)TSmalloc(sizeof(struct OptionInfo));
if (pOptionInfo == NULL) {
snprintf(errbuf, errbuf_size, "malloc %d bytes fail", (int)sizeof(struct OptionInfo));
- TSError("[%s] malloc %d bytes fail", __FUNCTION__, (int)sizeof(struct OptionInfo));
+ TSError("[esi][%s] malloc %d bytes fail", __FUNCTION__, (int)sizeof(struct OptionInfo));
return TS_ERROR;
}
if (esiPluginInit(index, new_argv, pOptionInfo) != 0) {
@@ -1747,7 +1747,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo * /* rri ATS_UNUSED
if (isInterceptRequest(txnp)) {
if (!setupServerIntercept(txnp)) {
- TSError("[%s] Could not setup server intercept", __FUNCTION__);
+ TSError("[esi][%s] Could not setup server intercept", __FUNCTION__);
} else {
TSDebug(DEBUG_TAG, "[%s] Setup server intercept", __FUNCTION__);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
index 3750ca5..4cc1f58 100644
--- a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
+++ b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
@@ -82,7 +82,7 @@ HttpDataFetcherImpl::addFetchRequest(const string &url, FetchedDataProcessor *ca
} else {
http_req = (char *)malloc(length + 1);
if (http_req == NULL) {
- TSError("[%s] malloc %d bytes fail", __FUNCTION__, length + 1);
+ TSError("[HttpDataFetcherImpl][%s] malloc %d bytes fail", __FUNCTION__, length + 1);
return false;
}
}
@@ -123,7 +123,7 @@ HttpDataFetcherImpl::handleFetchEvent(TSEvent event, void *edata)
{
int base_event_id;
if (!_isFetchEvent(event, base_event_id)) {
- TSError("[%s] Event %d is not a fetch event", __FUNCTION__, event);
+ TSError("[HttpDataFetcherImpl][%s] Event %d is not a fetch event", __FUNCTION__, event);
return false;
}
@@ -133,7 +133,7 @@ HttpDataFetcherImpl::handleFetchEvent(TSEvent event, void *edata)
if (req_data.complete) {
// can only happen if there's a bug in this or fetch API code
- TSError("[%s] URL [%s] already completed; Retaining original data", __FUNCTION__, req_str.c_str());
+ TSError("[HttpDataFetcherImpl][%s] URL [%s] already completed; Retaining original data", __FUNCTION__, req_str.c_str());
return false;
}
@@ -142,7 +142,7 @@ HttpDataFetcherImpl::handleFetchEvent(TSEvent event, void *edata)
int event_id = (static_cast<int>(event) - FETCH_EVENT_ID_BASE) % 3;
if (event_id != 0) { // failure or timeout
- TSError("[%s] Received failure/timeout event id %d for request [%s]", __FUNCTION__, event_id, req_str.data());
+ TSError("[HttpDataFetcherImpl][%s] Received failure/timeout event id %d for request [%s]", __FUNCTION__, event_id, req_str.data());
return true;
}
@@ -175,7 +175,7 @@ HttpDataFetcherImpl::handleFetchEvent(TSEvent event, void *edata)
req_data.raw_response.append(iter->data(), iter->size());
}
} else {
- TSError("[%s] Error while gunzipping data", __FUNCTION__);
+ TSError("[HttpDataFetcherImpl][%s] Error while gunzipping data", __FUNCTION__);
}
req_data.body_len = req_data.raw_response.size();
req_data.body = req_data.raw_response.data();
@@ -253,18 +253,18 @@ HttpDataFetcherImpl::getData(const string &url, ResponseData &resp_data) const
UrlToContentMap::const_iterator iter = _pages.find(url);
if (iter == _pages.end()) {
- TSError("Content being requested for unregistered URL [%s]", url.data());
+ TSError("[HttpDataFetcherImpl]Content being requested for unregistered URL [%s]", url.data());
return false;
}
const RequestData &req_data = iter->second; // handy reference
if (!req_data.complete) {
// request not completed yet
- TSError("Request for URL [%s] not complete", url.data());
+ TSError("[HttpDataFetcherImpl]Request for URL [%s] not complete", url.data());
return false;
}
if (req_data.response.empty()) {
// did not receive valid data
- TSError("No valid data received for URL [%s]; returning empty data to be safe", url.data());
+ TSError("[HttpDataFetcherImpl]No valid data received for URL [%s]; returning empty data to be safe", url.data());
resp_data.clear();
return false;
}
@@ -293,7 +293,7 @@ HttpDataFetcherImpl::getRequestStatus(const string &url) const
{
UrlToContentMap::const_iterator iter = _pages.find(url);
if (iter == _pages.end()) {
- TSError("Status being requested for unregistered URL [%s]", url.data());
+ TSError("[HttpDataFetcherImpl]Status being requested for unregistered URL [%s]", url.data());
return STATUS_ERROR;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/esi/serverIntercept.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/serverIntercept.cc b/plugins/experimental/esi/serverIntercept.cc
index d5638fb..f5ec06c 100644
--- a/plugins/experimental/esi/serverIntercept.cc
+++ b/plugins/experimental/esi/serverIntercept.cc
@@ -97,7 +97,7 @@ bool
SContData::init(TSVConn vconn)
{
if (initialized) {
- TSError("[%s] SContData already initialized!", __FUNCTION__);
+ TSError("[server_intercept][%s] SContData already initialized!", __FUNCTION__);
return false;
}
@@ -130,7 +130,7 @@ handleRead(SContData *cont_data, bool &read_complete)
{
int avail = TSIOBufferReaderAvail(cont_data->input.reader);
if (avail == TS_ERROR) {
- TSError("[%s] Error while getting number of bytes available", __FUNCTION__);
+ TSError("[server_intercept][%s] Error while getting number of bytes available", __FUNCTION__);
return false;
}
@@ -151,11 +151,11 @@ handleRead(SContData *cont_data, bool &read_complete)
TSMLoc content_len_loc =
TSMimeHdrFieldFind(cont_data->req_hdr_bufp, cont_data->req_hdr_loc, TS_MIME_FIELD_CONTENT_LENGTH, -1);
if (!content_len_loc) {
- TSError("[%s] Error while searching content length header [%s]", __FUNCTION__, TS_MIME_FIELD_CONTENT_LENGTH);
+ TSError("[server_intercept][%s] Error while searching content length header [%s]", __FUNCTION__, TS_MIME_FIELD_CONTENT_LENGTH);
return false;
}
if (!content_len_loc) {
- TSError("[%s] request doesn't contain content length header [%s]", __FUNCTION__, TS_MIME_FIELD_CONTENT_TYPE);
+ TSError("[server_intercept][%s] request doesn't contain content length header [%s]", __FUNCTION__, TS_MIME_FIELD_CONTENT_TYPE);
return false;
}
cont_data->req_content_len =
@@ -163,7 +163,7 @@ handleRead(SContData *cont_data, bool &read_complete)
TSHandleMLocRelease(cont_data->req_hdr_bufp, cont_data->req_hdr_loc, content_len_loc);
TSDebug(DEBUG_TAG, "[%s] Got content length as %d", __FUNCTION__, cont_data->req_content_len);
if (cont_data->req_content_len <= 0) {
- TSError("[%s] Invalid content length [%d]", __FUNCTION__, cont_data->req_content_len);
+ TSError("[server_intercept][%s] Invalid content length [%d]", __FUNCTION__, cont_data->req_content_len);
return false;
}
if (endptr - data) {
@@ -246,7 +246,7 @@ processRequest(SContData *cont_data)
int body_size = static_cast<int>(cont_data->body.size());
if (cont_data->req_content_len != body_size) {
- TSError("[%s] Read only %d bytes of body; expecting %d bytes", __FUNCTION__, body_size, cont_data->req_content_len);
+ TSError("[server_intercept][%s] Read only %d bytes of body; expecting %d bytes", __FUNCTION__, body_size, cont_data->req_content_len);
}
char buf[64];
@@ -257,11 +257,11 @@ processRequest(SContData *cont_data)
cont_data->setupWrite();
if (TSIOBufferWrite(cont_data->output.buffer, reply_header.data(), reply_header.size()) == TS_ERROR) {
- TSError("[%s] Error while writing reply header", __FUNCTION__);
+ TSError("[server_intercept][%s] Error while writing reply header", __FUNCTION__);
return false;
}
if (TSIOBufferWrite(cont_data->output.buffer, cont_data->body.data(), body_size) == TS_ERROR) {
- TSError("[%s] Error while writing content", __FUNCTION__);
+ TSError("[server_intercept][%s] Error while writing content", __FUNCTION__);
return false;
}
int total_bytes_written = reply_header.size() + body_size;
@@ -285,14 +285,14 @@ serverIntercept(TSCont contp, TSEvent event, void *edata)
TSDebug(DEBUG_TAG, "[%s] Received net accept event", __FUNCTION__);
TSAssert(cont_data->initialized == false);
if (!cont_data->init(static_cast<TSVConn>(edata))) {
- TSError("[%s] Could not initialize continuation data!", __FUNCTION__);
+ TSError("[server_intercept][%s] Could not initialize continuation data!", __FUNCTION__);
return 1;
}
break;
case TS_EVENT_VCONN_READ_READY:
TSDebug(DEBUG_TAG, "[%s] Received read ready event", __FUNCTION__);
if (!handleRead(cont_data, read_complete)) {
- TSError("[%s] Error while reading from input vio", __FUNCTION__);
+ TSError("[server_intercept][%s] Error while reading from input vio", __FUNCTION__);
return 0;
}
break;
@@ -311,7 +311,7 @@ serverIntercept(TSCont contp, TSEvent event, void *edata)
break;
case TS_EVENT_ERROR:
// todo: do some error handling here
- TSError("[%s] Received error event; going to shutdown, event: %d", __FUNCTION__, event);
+ TSError("[server_intercept][%s] Received error event; going to shutdown, event: %d", __FUNCTION__, event);
shutdown = true;
break;
default:
@@ -320,7 +320,7 @@ serverIntercept(TSCont contp, TSEvent event, void *edata)
if (read_complete) {
if (!processRequest(cont_data)) {
- TSError("[%s] Failed to process process", __FUNCTION__);
+ TSError("[server_intercept][%s] Failed to process process", __FUNCTION__);
} else {
TSDebug(DEBUG_TAG, "[%s] Processed request successfully", __FUNCTION__);
}
@@ -343,7 +343,7 @@ setupServerIntercept(TSHttpTxn txnp)
{
TSCont contp = TSContCreate(serverIntercept, TSMutexCreate());
if (!contp) {
- TSError("[%s] Could not create intercept request", __FUNCTION__);
+ TSError("[server_intercept][%s] Could not create intercept request", __FUNCTION__);
return false;
}
SContData *cont_data = new SContData(contp);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/geoip_acl/acl.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/geoip_acl/acl.cc b/plugins/experimental/geoip_acl/acl.cc
index 8008c0a..c40590b 100644
--- a/plugins/experimental/geoip_acl/acl.cc
+++ b/plugins/experimental/geoip_acl/acl.cc
@@ -39,7 +39,7 @@ Acl::read_html(const char *fn)
f.close();
TSDebug(PLUGIN_NAME, "Loaded HTML from %s", fn);
} else {
- TSError("Unable to open HTML file %s", fn);
+ TSError("[geoip_acl] Unable to open HTML file %s", fn);
}
}
@@ -71,7 +71,7 @@ RegexAcl::parse_line(const char *filename, const std::string &line, int lineno)
else if (tmp == "deny")
_acl->set_allow(false);
else {
- TSError("Bad action on in %s:line %d: %s", filename, lineno, tmp.c_str());
+ TSError("[geoip_acl] Bad action on in %s:line %d: %s", filename, lineno, tmp.c_str());
return false;
}
// The rest are "tokens"
@@ -102,11 +102,11 @@ RegexAcl::compile(const std::string &str, const char *filename, int lineno)
if (NULL != _rex) {
_extra = pcre_study(_rex, 0, &error);
if ((NULL == _extra) && error && (*error != 0)) {
- TSError("Failed to study regular expression in %s:line %d at offset %d: %s\n", filename, lineno, erroffset, error);
+ TSError("[geoip_acl] Failed to study regular expression in %s:line %d at offset %d: %s", filename, lineno, erroffset, error);
return false;
}
} else {
- TSError("Failed to compile regular expression in %s:line %d: %s\n", filename, lineno, error);
+ TSError("[geoip_acl] Failed to compile regular expression in %s:line %d: %s", filename, lineno, error);
return false;
}
@@ -141,7 +141,7 @@ CountryAcl::add_token(const std::string &str)
_iso_country_codes[iso] = true;
TSDebug(PLUGIN_NAME, "Added %s(%d) to remap rule, ACL=%d", str.c_str(), iso, _allow);
} else {
- TSError("Tried setting an ISO code (%d) outside the supported range", iso);
+ TSError("[geoip_acl] Tried setting an ISO code (%d) outside the supported range", iso);
}
}
@@ -172,7 +172,7 @@ CountryAcl::read_regex(const char *fn)
f.close();
TSDebug(PLUGIN_NAME, "Loaded regex rules from %s", fn);
} else {
- TSError("Unable to open regex file %s", fn);
+ TSError("[geoip_acl] Unable to open regex file %s", fn);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/geoip_acl/geoip_acl.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/geoip_acl/geoip_acl.cc b/plugins/experimental/geoip_acl/geoip_acl.cc
index 8d74189..ab3058e 100644
--- a/plugins/experimental/geoip_acl/geoip_acl.cc
+++ b/plugins/experimental/geoip_acl/geoip_acl.cc
@@ -59,7 +59,7 @@ TSReturnCode
TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf */, int /* errbuf_size */)
{
if (argc < 3) {
- TSError("Unable to create remap instance, need more parameters");
+ TSError("[geoip_acl] Unable to create remap instance, need more parameters");
return TS_ERROR;
} else {
Acl *a = NULL;
@@ -73,7 +73,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf */, int /
a->process_args(argc, argv);
*ih = static_cast<void *>(a);
} else {
- TSError("Unable to create remap instance, no supported ACL specified as first parameter");
+ TSError("[geoip_acl] Unable to create remap instance, no supported ACL specified as first parameter");
return TS_ERROR;
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/healthchecks/healthchecks.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/healthchecks.c b/plugins/experimental/healthchecks/healthchecks.c
index bb4fbb2..f4576b1 100644
--- a/plugins/experimental/healthchecks/healthchecks.c
+++ b/plugins/experimental/healthchecks/healthchecks.c
@@ -413,12 +413,12 @@ hc_process_read(TSCont contp, TSEvent event, HCState *my_state)
TSVConnShutdown(my_state->net_vc, 1, 0);
my_state->write_vio = TSVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT64_MAX);
} else if (event == TS_EVENT_ERROR) {
- TSError("hc_process_read: Received TS_EVENT_ERROR\n");
+ TSError("[healthchecks] hc_process_read: Received TS_EVENT_ERROR");
} else if (event == TS_EVENT_VCONN_EOS) {
/* client may end the connection, simply return */
return;
} else if (event == TS_EVENT_NET_ACCEPT_FAILED) {
- TSError("hc_process_read: Received TS_EVENT_NET_ACCEPT_FAILED\n");
+ TSError("[healthchecks] hc_process_read: Received TS_EVENT_NET_ACCEPT_FAILED");
} else {
TSReleaseAssert(!"Unexpected Event");
}
@@ -443,7 +443,7 @@ hc_process_write(TSCont contp, TSEvent event, HCState *my_state)
} else if (TS_EVENT_VCONN_WRITE_COMPLETE) {
cleanup(contp, my_state);
} else if (event == TS_EVENT_ERROR) {
- TSError("hc_process_write: Received TS_EVENT_ERROR\n");
+ TSError("[healthchecks] hc_process_write: Received TS_EVENT_ERROR");
} else {
TSReleaseAssert(!"Unexpected Event");
}
@@ -539,7 +539,7 @@ TSPluginInit(int argc, const char *argv[])
TSPluginRegistrationInfo info;
if (2 != argc) {
- TSError("Must specify a configuration file.\n");
+ TSError("[healthchecks] Must specify a configuration file.");
return;
}
@@ -548,20 +548,20 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "dev@trafficserver.apache.org";
if (TS_SUCCESS != TSPluginRegister(&info)) {
- TSError("Plugin registration failed. \n");
+ TSError("[healthchecks] Plugin registration failed.");
return;
}
/* This will update the global configuration file, and is not reloaded at run time */
/* ToDo: Support reloading with traffic_line -x ? */
if (NULL == (g_config = parse_configs(argv[1]))) {
- TSError("Unable to read / parse %s config file", argv[1]);
+ TSError("[healthchecks] Unable to read / parse %s config file", argv[1]);
return;
}
/* Setup the background thread */
if (!TSThreadCreate(hc_thread, NULL)) {
- TSError("Failure in thread creation");
+ TSError("[healthchecks] Failure in thread creation");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/hipes/hipes.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/hipes/hipes.cc b/plugins/experimental/hipes/hipes.cc
index f47f28f..935a804 100644
--- a/plugins/experimental/hipes/hipes.cc
+++ b/plugins/experimental/hipes/hipes.cc
@@ -179,7 +179,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
*ih = (void *)ri;
if (ri == NULL) {
- TSError("Unable to create remap instance");
+ TSError("[hipes] Unable to create remap instance");
return TS_ERROR;
}
@@ -188,7 +188,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
std::string::size_type sep = arg.find_first_of(":");
if (sep == std::string::npos) {
- TSError("Malformed options in url_remap: %s", argv[ix]);
+ TSError("[hipes] Malformed options in url_remap: %s", argv[ix]);
} else {
std::string arg_val = arg.substr(sep + 1, std::string::npos);
@@ -229,7 +229,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
} else if (arg.compare(0, 11, "dns_timeout") == 0) {
ri->dns_timeout = atoi(arg_val.c_str());
} else {
- TSError("Unknown url_remap option: %s", argv[ix]);
+ TSError("[hipes] Unknown url_remap option: %s", argv[ix]);
}
}
}
@@ -435,7 +435,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
}
if (len > MAX_REDIRECT_URL) {
- TSError("Redirect in HIPES URL too long");
+ TSError("[hipes] Redirect in HIPES URL too long");
TSHttpTxnSetHttpRetStatus(rh, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
} else {
int port = -1;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/memcached_remap/memcached_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/memcached_remap/memcached_remap.cc b/plugins/experimental/memcached_remap/memcached_remap.cc
index 7f8320e..8bff79a 100644
--- a/plugins/experimental/memcached_remap/memcached_remap.cc
+++ b/plugins/experimental/memcached_remap/memcached_remap.cc
@@ -173,7 +173,7 @@ TSPluginInit(int argc, const char *argv[])
TSDebug(PLUGIN_NAME, "about to init memcached\n");
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("memcached_remap: plugin registration failed.\n");
+ TSError("[memcached_remap] Plugin registration failed.\n");
return;
}
@@ -207,13 +207,13 @@ TSPluginInit(int argc, const char *argv[])
servers = memcached_server_list_append(NULL, "localhost", 11211, &rc);
if (rc != MEMCACHED_SUCCESS) {
- TSError("memcached_remap: plugin registration failed while adding servers.\n");
+ TSError("[memcached_remap] Plugin registration failed while adding servers.\n");
return;
}
rc = memcached_server_push(memc, servers);
if (rc != MEMCACHED_SUCCESS) {
- TSError("memcached_remap: plugin registration failed while adding to pool.\n");
+ TSError("[memcached_remap] Plugin registration failed while adding to pool.\n");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/metalink/metalink.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/metalink/metalink.cc b/plugins/experimental/metalink/metalink.cc
index 0b34ca1..0b16b1b 100644
--- a/plugins/experimental/metalink/metalink.cc
+++ b/plugins/experimental/metalink/metalink.cc
@@ -120,7 +120,7 @@ cache_open_write(TSCont contp, void *edata)
TSCacheKeyDestroy(data->key);
if (TSHttpTxnClientReqGet(data->txnp, &req_bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("Couldn't retrieve client request header");
+ TSError("[metalink] Couldn't retrieve client request header");
TSContDestroy(contp);
@@ -773,7 +773,7 @@ http_send_response_hdr(TSCont contp, void *edata)
data->txnp = (TSHttpTxn)edata;
if (TSHttpTxnClientRespGet(data->txnp, &data->resp_bufp, &data->hdr_loc) != TS_SUCCESS) {
- TSError("Couldn't retrieve client response header");
+ TSError("[metalink] Couldn't retrieve client response header");
TSHttpTxnReenable(data->txnp, TS_EVENT_HTTP_CONTINUE);
TSfree(data);
@@ -910,7 +910,7 @@ TSPluginInit(int /* argc ATS_UNUSED */, const char * /* argv ATS_UNUSED */ [])
info.support_email = (char *)"dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed");
+ TSError("[metalink] Plugin registration failed");
}
TSCont contp = TSContCreate(handler, NULL);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/mysql_remap/mysql_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/mysql_remap/mysql_remap.cc b/plugins/experimental/mysql_remap/mysql_remap.cc
index bba3563..476a115 100644
--- a/plugins/experimental/mysql_remap/mysql_remap.cc
+++ b/plugins/experimental/mysql_remap/mysql_remap.cc
@@ -191,17 +191,17 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = const_cast<char *>("dev@trafficserver.apache.org");
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("mysql_remap: plugin registration failed.\n");
+ TSError("[mysql_remap] Plugin registration failed.");
}
if (argc != 2) {
- TSError("usage: %s /path/to/sample.ini\n", argv[0]);
+ TSError("[mysql_remap] Usage: %s /path/to/sample.ini", argv[0]);
return;
}
ini = iniparser_load(argv[1]);
if (!ini) {
- TSError("Error with ini file (1)");
+ TSError("[mysql_remap] Error with ini file (1)");
TSDebug(PLUGIN_NAME, "Error parsing ini file(1)");
return;
}
@@ -213,13 +213,13 @@ TSPluginInit(int argc, const char *argv[])
db = iniparser_getstring(ini, "mysql_remap:mysql_database", (char *)"mysql_remap");
if (mysql_library_init(0, NULL, NULL)) {
- TSError("Error initializing mysql client library");
+ TSError("[mysql_remap] Error initializing mysql client library");
TSDebug(PLUGIN_NAME, "Error initializing mysql client library");
return;
}
if (!mysql_init(&mysql)) {
- TSError("Could not initialize MySQL");
+ TSError("[mysql_remap] Could not initialize MySQL");
TSDebug(PLUGIN_NAME, "Could not initialize MySQL");
return;
}
@@ -227,7 +227,7 @@ TSPluginInit(int argc, const char *argv[])
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
if (!mysql_real_connect(&mysql, host, username, password, db, port, NULL, 0)) {
- TSError("Could not connect to mysql");
+ TSError("[mysql_remap] Could not connect to mysql");
TSDebug(PLUGIN_NAME, "Could not connect to mysql: %s", mysql_error(&mysql));
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/regex_revalidate/regex_revalidate.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/regex_revalidate/regex_revalidate.c b/plugins/experimental/regex_revalidate/regex_revalidate.c
index d711e4e..1835b5d 100644
--- a/plugins/experimental/regex_revalidate/regex_revalidate.c
+++ b/plugins/experimental/regex_revalidate/regex_revalidate.c
@@ -487,7 +487,7 @@ TSPluginInit(int argc, const char *argv[])
}
if (!pstate->config_file) {
- TSError("Plugin requires a --config option along with a config file name.");
+ TSError("[regex_revalidate] Plugin requires a --config option along with a config file name.");
free_plugin_state_t(pstate);
return;
}
@@ -504,14 +504,15 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.");
+ TSError("[regex_revalidate] Plugin registration failed.");
+
free_plugin_state_t(pstate);
return;
} else
TSDebug(LOG_PREFIX, "Plugin registration succeeded.");
if (!check_ts_version()) {
- TSError("Plugin requires Traffic Server %d.%d.%d", TS_VERSION_MAJOR, TS_VERSION_MINOR, TS_VERSION_MICRO);
+ 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;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/remap_stats/remap_stats.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/remap_stats/remap_stats.c b/plugins/experimental/remap_stats/remap_stats.c
index c82401b..df0f485 100644
--- a/plugins/experimental/remap_stats/remap_stats.c
+++ b/plugins/experimental/remap_stats/remap_stats.c
@@ -244,7 +244,8 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.");
+ TSError("[remap_stats] Plugin registration failed.");
+
return;
} else
TSDebug(DEBUG_TAG, "Plugin registration succeeded.");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/s3_auth/s3_auth.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/s3_auth/s3_auth.cc b/plugins/experimental/s3_auth/s3_auth.cc
index aec74f3..561ffc5 100644
--- a/plugins/experimental/s3_auth/s3_auth.cc
+++ b/plugins/experimental/s3_auth/s3_auth.cc
@@ -149,7 +149,7 @@ bool
S3Config::parse_config(const char *config)
{
if (!config) {
- TSError("%s: called without a config file, this is broken", PLUGIN_NAME);
+ TSError("[%s] called without a config file, this is broken", PLUGIN_NAME);
return false;
} else {
char filename[PATH_MAX + 1];
@@ -163,7 +163,7 @@ S3Config::parse_config(const char *config)
FILE *file = fopen(config, "r");
if (NULL == file) {
- TSError("%s: unable to open %s", PLUGIN_NAME, config);
+ TSError("[%s] unable to open %s", PLUGIN_NAME, config);
return false;
}
@@ -505,7 +505,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
// Make sure we got both the shared secret and the AWS secret
if (!s3->valid()) {
- TSError("%s: requires both shared and AWS secret configuration", PLUGIN_NAME);
+ TSError("[%s] requires both shared and AWS secret configuration", PLUGIN_NAME);
delete s3;
*ih = NULL;
return TS_ERROR;
@@ -545,7 +545,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo * /* rri */)
s3->schedule(txnp);
} else {
TSDebug(PLUGIN_NAME, "Remap context is invalid");
- TSError("%s: No remap context available, check code / config", PLUGIN_NAME);
+ TSError("[%s] No remap context available, check code / config", PLUGIN_NAME);
TSHttpTxnSetHttpRetStatus(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/sslheaders/sslheaders.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/sslheaders/sslheaders.cc b/plugins/experimental/sslheaders/sslheaders.cc
index 15eeec1..da60505 100644
--- a/plugins/experimental/sslheaders/sslheaders.cc
+++ b/plugins/experimental/sslheaders/sslheaders.cc
@@ -188,7 +188,7 @@ SslHdrParseOptions(int argc, const char **argv)
} else if (strcmp(optarg, "both") == 0) {
hdr->attach = SSL_HEADERS_ATTACH_BOTH;
} else {
- TSError("%s: invalid attach option '%s'", PLUGIN_NAME, optarg);
+ TSError("[%s] Invalid attach option '%s'", PLUGIN_NAME, optarg);
return NULL;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/sslheaders/sslheaders.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/sslheaders/sslheaders.h b/plugins/experimental/sslheaders/sslheaders.h
index c4e3072..13bb2cb 100644
--- a/plugins/experimental/sslheaders/sslheaders.h
+++ b/plugins/experimental/sslheaders/sslheaders.h
@@ -30,7 +30,7 @@ typedef struct bio_st BIO;
#define PLUGIN_NAME "sslheaders"
#define SslHdrDebug(fmt, ...) TSDebug(PLUGIN_NAME, "%s: " fmt, __func__, ##__VA_ARGS__)
-#define SslHdrError(fmt, ...) TSError(PLUGIN_NAME ": %s: " fmt, __func__, ##__VA_ARGS__)
+#define SslHdrError(fmt, ...) TSError("["PLUGIN_NAME"] " ": %s: " fmt, __func__, ##__VA_ARGS__)
enum AttachOptions {
SSL_HEADERS_ATTACH_CLIENT,
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/stale_while_revalidate/stale_while_revalidate.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/stale_while_revalidate/stale_while_revalidate.c b/plugins/experimental/stale_while_revalidate/stale_while_revalidate.c
index 13beae7..4a48400 100644
--- a/plugins/experimental/stale_while_revalidate/stale_while_revalidate.c
+++ b/plugins/experimental/stale_while_revalidate/stale_while_revalidate.c
@@ -352,7 +352,7 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
TSContDestroy(cont);
break;
default:
- TSError("Unknown event %d.", event);
+ TSError("[stale_while_revalidate] Unknown event %d.", event);
break;
}
@@ -616,7 +616,8 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[%s] Plugin registration failed.\n", PLUGIN_NAME);
+
return;
} else {
TSDebug(PLUGIN_NAME, "Plugin registration succeeded.\n");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua.c b/plugins/experimental/ts_lua/ts_lua.c
index cea09ed..b20cf3f 100644
--- a/plugins/experimental/ts_lua/ts_lua.c
+++ b/plugins/experimental/ts_lua/ts_lua.c
@@ -166,7 +166,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
ts_lua_set_cont_info(L, NULL);
if (lua_pcall(L, 0, 1, 0) != 0) {
- TSError("lua_pcall failed: %s", lua_tostring(L, -1));
+ TSError("[ts_lua] lua_pcall failed: %s", lua_tostring(L, -1));
ret = TSREMAP_NO_REMAP;
} else {
@@ -317,7 +317,7 @@ globalHookHandler(TSCont contp, TSEvent event ATS_UNUSED, void *edata)
ts_lua_set_cont_info(l, NULL);
if (lua_pcall(l, 0, 1, 0) != 0) {
- TSError("lua_pcall failed: %s", lua_tostring(l, -1));
+ TSError("[ts_lua] lua_pcall failed: %s", lua_tostring(l, -1));
}
ret = lua_tointeger(l, -1);
@@ -353,7 +353,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed. \n");
+ TSError("[ts_lua] Plugin registration failed.");
}
int ret = 0;
@@ -369,18 +369,18 @@ TSPluginInit(int argc, const char *argv[])
}
if (argc < 2) {
- TSError("[%s] lua script file required !!", __FUNCTION__);
+ TSError("[ts_lua][%s] lua script file required !!", __FUNCTION__);
return;
}
if (strlen(argv[1]) >= TS_LUA_MAX_SCRIPT_FNAME_LENGTH - 16) {
- TSError("[%s] lua script file name too long !!", __FUNCTION__);
+ TSError("[ts_lua][%s] lua script file name too long !!", __FUNCTION__);
return;
}
ts_lua_instance_conf *conf = TSmalloc(sizeof(ts_lua_instance_conf));
if (!conf) {
- TSError("[%s] TSmalloc failed !!", __FUNCTION__);
+ TSError("[ts_lua][%s] TSmalloc failed !!", __FUNCTION__);
return;
}
memset(conf, 0, sizeof(ts_lua_instance_conf));
@@ -397,13 +397,13 @@ TSPluginInit(int argc, const char *argv[])
if (ret != 0) {
TSError(errbuf, NULL);
- TSError("[%s] ts_lua_add_module failed", __FUNCTION__);
+ TSError("[ts_lua][%s] ts_lua_add_module failed", __FUNCTION__);
return;
}
TSCont global_contp = TSContCreate(globalHookHandler, NULL);
if (!global_contp) {
- TSError("[%s] could not create transaction start continuation", __FUNCTION__);
+ TSError("[ts_lua][%s] could not create transaction start continuation", __FUNCTION__);
return;
}
TSContDataSet(global_contp, conf);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_client_request.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_client_request.c b/plugins/experimental/ts_lua/ts_lua_client_request.c
index fd3e912..ad3e9a2 100644
--- a/plugins/experimental/ts_lua/ts_lua_client_request.c
+++ b/plugins/experimental/ts_lua/ts_lua_client_request.c
@@ -203,7 +203,7 @@ ts_lua_client_request_header_set(lua_State *L)
} else if (TSMimeHdrFieldCreateNamed(http_ctx->client_request_bufp, http_ctx->client_request_hdrp, key, key_len, &field_loc) !=
TS_SUCCESS) {
- TSError("[%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
+ TSError("[ts_lua][%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
return 0;
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_client_response.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_client_response.c b/plugins/experimental/ts_lua/ts_lua_client_response.c
index a0cc382..d4142b1 100644
--- a/plugins/experimental/ts_lua/ts_lua_client_response.c
+++ b/plugins/experimental/ts_lua/ts_lua_client_response.c
@@ -163,7 +163,7 @@ ts_lua_client_response_header_set(lua_State *L)
} else if (TSMimeHdrFieldCreateNamed(http_ctx->client_response_bufp, http_ctx->client_response_hdrp, key, key_len, &field_loc) !=
TS_SUCCESS) {
- TSError("[%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
+ TSError("[ts_lua][%s] TSMimeHdrFieldCreateNamed error", __FUNCTION__);
return 0;
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_http_config.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c
index f6a5182..bdf7a78 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -368,7 +368,7 @@ ts_lua_http_timeout_set(lua_State *L)
break;
default:
- TSError("unsupported timeout config option for lua plugin");
+ TSError("[ts_lua] Unsupported timeout config option for lua plugin");
break;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_http_intercept.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_http_intercept.c b/plugins/experimental/ts_lua/ts_lua_http_intercept.c
index 031def8..e2fbd9d 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_intercept.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_intercept.c
@@ -74,13 +74,13 @@ ts_lua_http_intercept(lua_State *L)
n = lua_gettop(L);
if (n < 1) {
- TSError("ts.http.intercept need at least one param");
+ TSError("[ts_lua] ts.http.intercept need at least one param");
return 0;
}
type = lua_type(L, 1);
if (type != LUA_TFUNCTION) {
- TSError("ts.http.intercept should use function as param, but there is %s", lua_typename(L, type));
+ TSError("[ts_lua] ts.http.intercept should use function as param, but there is %s", lua_typename(L, type));
return 0;
}
@@ -106,13 +106,13 @@ ts_lua_http_server_intercept(lua_State *L)
n = lua_gettop(L);
if (n < 1) {
- TSError("ts.http.server_intercept need at least one param");
+ TSError("[ts_lua] ts.http.server_intercept need at least one param");
return 0;
}
type = lua_type(L, 1);
if (type != LUA_TFUNCTION) {
- TSError("ts.http.server_intercept should use function as param, but there is %s", lua_typename(L, type));
+ TSError("[ts_lua] ts.http.server_intercept should use function as param, but there is %s", lua_typename(L, type));
return 0;
}
@@ -273,7 +273,7 @@ ts_lua_http_intercept_run_coroutine(ts_lua_http_intercept_ctx *ictx, int n)
break;
default: // error
- TSError("lua_resume failed: %s", lua_tostring(L, -1));
+ TSError("[ts_lua] lua_resume failed: %s", lua_tostring(L, -1));
lua_pop(L, 1);
return -1;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_log.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_log.c b/plugins/experimental/ts_lua/ts_lua_log.c
index e1fed98..5337641 100644
--- a/plugins/experimental/ts_lua/ts_lua_log.c
+++ b/plugins/experimental/ts_lua/ts_lua_log.c
@@ -60,7 +60,7 @@ ts_lua_log_object_creat(lua_State *L)
log_name = luaL_checklstring(L, -2, &name_len);
if (lua_isnil(L, 3)) {
- TSError("no log name!!");
+ TSError("[ts_lua] No log name!!");
return -1;
} else {
log_mode = luaL_checknumber(L, 3);
@@ -69,7 +69,7 @@ ts_lua_log_object_creat(lua_State *L)
error = TSTextLogObjectCreate(log_name, log_mode, &log);
if (!log || error == TS_ERROR) {
- TSError("creat log error <%s>", log_name);
+ TSError("[ts_lua] Unable to create log <%s>", log_name);
return -1;
}
return 0;
@@ -92,7 +92,7 @@ ts_lua_log_object_write(lua_State *L)
if (log) {
TSTextLogObjectWrite(log, (char *)text, NULL);
} else {
- TSError("[%s] log is not exsited!", __FUNCTION__);
+ TSError("[ts_lua][%s] log is not exsited!", __FUNCTION__);
}
return 0;
@@ -109,7 +109,7 @@ static int
ts_lua_log_object_destroy(lua_State *L ATS_UNUSED)
{
if (TSTextLogObjectDestroy(log) != TS_SUCCESS)
- TSError("[%s] TSTextLogObjectDestroy error!", __FUNCTION__);
+ TSError("[ts_lua][%s] TSTextLogObjectDestroy error!", __FUNCTION__);
return 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ts_lua/ts_lua_package.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_package.c b/plugins/experimental/ts_lua/ts_lua_package.c
index 04cf4ba..2f9bbdb 100644
--- a/plugins/experimental/ts_lua/ts_lua_package.c
+++ b/plugins/experimental/ts_lua/ts_lua_package.c
@@ -186,7 +186,7 @@ ts_lua_add_package_path_items(lua_State *L, ts_lua_package_path *pp, int n)
for (i = 0; i < n; i++) {
if (new_path_len + pp[i].len + 1 >= sizeof(new_path)) {
- TSError("extended package.path is too long.");
+ TSError("[ts_lua] Extended package.path is too long.");
return -1;
}
@@ -332,7 +332,7 @@ ts_lua_add_package_cpath_items(lua_State *L, ts_lua_package_path *pp, int n)
for (i = 0; i < n; i++) {
if (new_path_len + pp[i].len + 1 >= sizeof(new_path)) {
- TSError("extended package.cpath is too long.");
+ TSError("[ts_lua] Extended package.cpath is too long.");
return -1;
}
[3/3] trafficserver git commit: TS-2106 Added plugin names to all
TSError messages. Removed extraneous newlines. This closes #220.
Posted by am...@apache.org.
TS-2106 Added plugin names to all TSError messages. Removed extraneous newlines.
This closes #220.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/28b243b0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/28b243b0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/28b243b0
Branch: refs/heads/master
Commit: 28b243b06a620c58a5b2a12b9575b58688e4e12f
Parents: 94476aa
Author: Jun Jie Ng <ng...@gmail.com>
Authored: Thu Jun 11 21:37:32 2015 +0000
Committer: Alan M. Carroll <am...@apache.org>
Committed: Tue Jun 23 15:26:11 2015 -0500
----------------------------------------------------------------------
...gin-registration-and-version-checking.en.rst | 4 +-
.../working-with-http-headers.en.rst | 10 +-
.../working-with-http-header-functions.en.rst | 6 +-
doc/sdk/remap-plugin/example-query-remap.en.rst | 2 +-
doc/sdk/sample-source-code.en.rst | 22 ++--
example/add-header/add-header.c | 28 ++---
example/append-transform/append-transform.c | 8 +-
example/basic-auth/basic-auth.c | 16 +--
example/blacklist-0/blacklist-0.c | 14 +--
example/blacklist-1/blacklist-1.c | 18 +--
example/bnull-transform/bnull-transform.c | 7 +-
example/cache-scan/cache-scan.cc | 14 +--
example/file-1/file-1.c | 2 +-
example/hello/hello.c | 2 +-
example/lifecycle-plugin/lifecycle-plugin.c | 7 +-
example/null-transform/null-transform.c | 7 +-
example/output-header/output-header.c | 9 +-
example/protocol/Protocol.c | 9 +-
example/protocol/TxnSM.c | 6 +-
example/query-remap/query-remap.c | 4 +-
example/redirect-1/redirect-1.c | 12 +-
example/remap/remap.cc | 2 +-
example/remap_header_add/remap_header_add.cc | 8 +-
example/replace-header/replace-header.c | 4 +-
example/response-header-1/response-header-1.c | 24 ++--
example/secure-link/secure-link.c | 10 +-
example/server-transform/server-transform.c | 26 ++---
example/session-1/session-1.c | 5 +-
example/thread-1/thread-1.c | 2 +-
example/thread-pool/psi.c | 8 +-
example/thread-pool/thread.c | 2 +-
example/version/version.c | 14 ++-
plugins/cacheurl/cacheurl.cc | 28 ++---
plugins/conf_remap/conf_remap.cc | 20 ++--
.../ats_pagespeed/ats_base_fetch.cc | 2 +-
.../ats_pagespeed/ats_beacon_intercept.cc | 22 ++--
.../experimental/ats_pagespeed/ats_config.cc | 5 +-
.../ats_pagespeed/ats_header_utils.cc | 2 +-
.../experimental/ats_pagespeed/ats_pagespeed.cc | 16 +--
.../ats_pagespeed/ats_resource_intercept.cc | 10 +-
.../background_fetch/background_fetch.cc | 16 +--
.../experimental/background_fetch/configs.cc | 12 +-
plugins/experimental/background_fetch/rules.cc | 8 +-
plugins/experimental/balancer/balancer.cc | 4 +-
plugins/experimental/balancer/hash.cc | 2 +-
plugins/experimental/balancer/roundrobin.cc | 2 +-
.../experimental/buffer_upload/buffer_upload.cc | 40 +++----
.../experimental/cache_promote/cache_promote.cc | 10 +-
.../cache_range_requests.cc | 4 +-
.../collapsed_connection.cc | 20 ++--
.../custom_redirect/custom_redirect.cc | 6 +-
plugins/experimental/epic/epic.cc | 2 +-
plugins/experimental/esi/esi.cc | 112 +++++++++----------
.../esi/fetcher/HttpDataFetcherImpl.cc | 18 +--
plugins/experimental/esi/serverIntercept.cc | 26 ++---
plugins/experimental/geoip_acl/acl.cc | 12 +-
plugins/experimental/geoip_acl/geoip_acl.cc | 4 +-
.../experimental/healthchecks/healthchecks.c | 14 +--
plugins/experimental/hipes/hipes.cc | 8 +-
.../memcached_remap/memcached_remap.cc | 6 +-
plugins/experimental/metalink/metalink.cc | 6 +-
plugins/experimental/mysql_remap/mysql_remap.cc | 12 +-
.../regex_revalidate/regex_revalidate.c | 7 +-
plugins/experimental/remap_stats/remap_stats.c | 3 +-
plugins/experimental/s3_auth/s3_auth.cc | 8 +-
plugins/experimental/sslheaders/sslheaders.cc | 2 +-
plugins/experimental/sslheaders/sslheaders.h | 2 +-
.../stale_while_revalidate.c | 5 +-
plugins/experimental/ts_lua/ts_lua.c | 16 +--
.../experimental/ts_lua/ts_lua_client_request.c | 2 +-
.../ts_lua/ts_lua_client_response.c | 2 +-
.../experimental/ts_lua/ts_lua_http_config.c | 2 +-
.../experimental/ts_lua/ts_lua_http_intercept.c | 10 +-
plugins/experimental/ts_lua/ts_lua_log.c | 8 +-
plugins/experimental/ts_lua/ts_lua_package.c | 4 +-
.../experimental/ts_lua/ts_lua_server_request.c | 2 +-
.../ts_lua/ts_lua_server_response.c | 2 +-
plugins/experimental/ts_lua/ts_lua_transform.c | 2 +-
plugins/experimental/ts_lua/ts_lua_util.c | 6 +-
plugins/experimental/url_sig/url_sig.c | 12 +-
plugins/experimental/xdebug/xdebug.cc | 2 +-
plugins/header_rewrite/condition.cc | 2 +-
plugins/header_rewrite/conditions.cc | 8 +-
plugins/header_rewrite/factory.cc | 4 +-
plugins/header_rewrite/header_rewrite.cc | 16 +--
plugins/header_rewrite/operators.cc | 16 +--
plugins/header_rewrite/parser.cc | 4 +-
plugins/header_rewrite/ruleset.cc | 4 +-
plugins/regex_remap/regex_remap.cc | 28 ++---
plugins/stats_over_http/stats_over_http.c | 6 +-
proxy/InkAPITest.cc | 6 +-
91 files changed, 485 insertions(+), 467 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/doc/sdk/getting-started/plugin-registration-and-version-checking.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/getting-started/plugin-registration-and-version-checking.en.rst b/doc/sdk/getting-started/plugin-registration-and-version-checking.en.rst
index 10de7d7..17f5c24 100644
--- a/doc/sdk/getting-started/plugin-registration-and-version-checking.en.rst
+++ b/doc/sdk/getting-started/plugin-registration-and-version-checking.en.rst
@@ -72,11 +72,11 @@ ensures it's running with a compatible version of Traffic Server.
info.support_email = "ts-api-support@MyCompany.com";
if (!TSPluginRegister(&info)) {
- TSError ("Plugin registration failed. \n");
+ TSError ("[plugin_name] Plugin registration failed.");
}
if (!check_ts_version()) {
- TSError ("Plugin requires Traffic Server 2.0 or later\n");
+ TSError ("[plugin_name] Plugin requires Traffic Server 2.0 or later");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/doc/sdk/header-based-plugin-examples/basic-authorization-plugin/working-with-http-headers.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/header-based-plugin-examples/basic-authorization-plugin/working-with-http-headers.en.rst b/doc/sdk/header-based-plugin-examples/basic-authorization-plugin/working-with-http-headers.en.rst
index 9e26fe6..5198b4d 100644
--- a/doc/sdk/header-based-plugin-examples/basic-authorization-plugin/working-with-http-headers.en.rst
+++ b/doc/sdk/header-based-plugin-examples/basic-authorization-plugin/working-with-http-headers.en.rst
@@ -35,7 +35,7 @@ check the ``Proxy-Authorization`` field. The ``handle_dns`` routine uses
char *user, *password;
if (!TSHttpTxnClientReqGet (txnp, &bufp, &hdr_loc)) {
- TSError ("couldn't retrieve client request header\n");
+ TSError ("[basic_authorization] Couldn't retrieve client request header");
goto done;
}
@@ -50,14 +50,14 @@ are present and valid:
val = TSMimeHdrFieldValueStringGet (bufp, hdr_loc, field_loc, -1, &authval_length);
if (!val) {
- TSError ("no value in Proxy-Authorization field\n");
+ TSError ("[basic_authorization] No value in Proxy-Authorization field");
TSHandleMLocRelease (bufp, hdr_loc, field_loc);
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
if (strncmp (val, "Basic", 5) != 0) {
- TSError ("no Basic auth type in Proxy-Authorization\n");
+ TSError ("[basic_authorization] No Basic auth type in Proxy-Authorization");
TSHandleMLocRelease (bufp, hdr_loc, field_loc);
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -71,7 +71,7 @@ are present and valid:
user = base64_decode (val);
password = strchr (user, ':');
if (!password) {
- TSError ("no password in authorization information\n");
+ TSError ("[basic_authorization] No password in authorization information");
TSfree (user);
TSHandleMLocRelease (bufp, hdr_loc, field_loc);
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
@@ -81,7 +81,7 @@ are present and valid:
password += 1;
if (!authorized (user, password)) {
- TSError ("%s:%s not authorized\n", user, password);
+ TSError ("[basic_authorization] %s:%s not authorized", user, password);
TSfree (user);
TSHandleMLocRelease (bufp, hdr_loc, field_loc);
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/doc/sdk/header-based-plugin-examples/blacklist-plugin/working-with-http-header-functions.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/header-based-plugin-examples/blacklist-plugin/working-with-http-header-functions.en.rst b/doc/sdk/header-based-plugin-examples/blacklist-plugin/working-with-http-header-functions.en.rst
index afe5e80..d5acad0 100644
--- a/doc/sdk/header-based-plugin-examples/blacklist-plugin/working-with-http-header-functions.en.rst
+++ b/doc/sdk/header-based-plugin-examples/blacklist-plugin/working-with-http-header-functions.en.rst
@@ -35,19 +35,19 @@ transaction. This is done in the ``handle_dns`` routine, using
int host_length;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[blacklist] Couldn't retrieve client request header");
goto done;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[blacklist] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
host = TSUrlHostGet(bufp, url_loc, &host_length);
if (!host) {
- TSError("couldn't retrieve request hostname\n");
+ TSError("[blacklist] couldn't retrieve request hostname");
TSHandleMLocRelease(bufp, hdr_loc, url_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/doc/sdk/remap-plugin/example-query-remap.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/remap-plugin/example-query-remap.en.rst b/doc/sdk/remap-plugin/example-query-remap.en.rst
index acf136a..9c359f4 100644
--- a/doc/sdk/remap-plugin/example-query-remap.en.rst
+++ b/doc/sdk/remap-plugin/example-query-remap.en.rst
@@ -108,7 +108,7 @@ modify the request host:
query_remap_info *qri = (query_remap_info*)ih;
if (!qri) {
- TSError("NULL ihandle");
+ TSError("[remap] NULL ihandle");
return 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/doc/sdk/sample-source-code.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/sample-source-code.en.rst b/doc/sdk/sample-source-code.en.rst
index 11192a8..d216a6a 100644
--- a/doc/sdk/sample-source-code.en.rst
+++ b/doc/sdk/sample-source-code.en.rst
@@ -80,20 +80,20 @@ This plugin illustrates:
int host_length;
if (!TSHttpTxnClientReqGet (txnp, &bufp, &hdr_loc)) {
- TSError ("couldn't retrieve client request header\n");
+ TSError ("[blacklist-1] Couldn't retrieve client request header");
goto done;
}
url_loc = TSHttpHdrUrlGet (bufp, hdr_loc);
if (!url_loc) {
- TSError ("couldn't retrieve request url\n");
+ TSError ("[blacklist-1] Couldn't retrieve request url");
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
host = TSUrlHostGet (bufp, url_loc, &host_length);
if (!host) {
- TSError ("couldn't retrieve request hostname\n");
+ TSError ("[blacklist-1] Couldn't retrieve request hostname");
TSHandleMLocRelease (bufp, hdr_loc, url_loc);
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -136,7 +136,7 @@ This plugin illustrates:
int url_length;
if (!TSHttpTxnClientRespGet (txnp, &bufp, &hdr_loc)) {
- TSError ("couldn't retrieve client response header\n");
+ TSError ("[blacklist-1] Couldn't retrieve client response header");
goto done;
}
@@ -146,14 +146,14 @@ This plugin illustrates:
strlen (TSHttpHdrReasonLookup (TS_HTTP_STATUS_FORBIDDEN)) );
if (!TSHttpTxnClientReqGet (txnp, &bufp, &hdr_loc)) {
- TSError ("couldn't retrieve client request header\n");
+ TSError ("[blacklist-1] Couldn't retrieve client request header");
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
url_loc = TSHttpHdrUrlGet (bufp, hdr_loc);
if (!url_loc) {
- TSError ("couldn't retrieve request url\n");
+ TSError ("[blacklist-1] Couldn't retrieve request url");
TSHandleMLocRelease (bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
@@ -207,8 +207,8 @@ This plugin illustrates:
TSfclose (file);
} else {
- TSError ("unable to open %s\n", blacklist_file);
- TSError ("all sites will be allowed\n", blacklist_file);
+ TSError ("[blacklist-1] Unable to open %s", blacklist_file);
+ TSError ("[blacklist-1] All sites will be allowed", blacklist_file);
}
TSMutexUnlock (sites_mutex);
@@ -272,12 +272,12 @@ This plugin illustrates:
info.vendor_name = "DsCompany";
info.support_email = "ts-api-support@DsCompany.com";
- if (!TSPluginRegister (&info)) {
- TSError ("Plugin registration failed.\n");
+ if (!TSPluginRegister(&info)) {
+ TSError ("[blacklist-1] Plugin registration failed.");
}
if (!check_ts_version()) {
- TSError ("Plugin requires Traffic Server 2.0 or later\n");
+ TSError ("[blacklist-1] Plugin requires Traffic Server 2.0 or later");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/add-header/add-header.c
----------------------------------------------------------------------
diff --git a/example/add-header/add-header.c b/example/add-header/add-header.c
index e156a34..e2dd814 100644
--- a/example/add-header/add-header.c
+++ b/example/add-header/add-header.c
@@ -53,13 +53,13 @@ add_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
int retval;
if (TSHttpTxnClientReqGet(txnp, &req_bufp, &req_loc) != TS_SUCCESS) {
- TSError("[add_header] Error while retrieving client request header\n");
+ TSError("[add_header] Unable to retrieve client request header");
goto done;
}
field_loc = TSMimeHdrFieldGet(hdr_bufp, hdr_loc, 0);
if (field_loc == TS_NULL_MLOC) {
- TSError("[add_header] Error while getting field");
+ TSError("[add_header] Unable to get field");
goto error;
}
@@ -67,7 +67,7 @@ add_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
while (field_loc) {
/* First create a new field in the client request header */
if (TSMimeHdrFieldCreate(req_bufp, req_loc, &new_field_loc) != TS_SUCCESS) {
- TSError("[add_header] Error while creating new field");
+ TSError("[add_header] Unable to create new field");
TSHandleMLocRelease(hdr_bufp, hdr_loc, field_loc);
break;
}
@@ -75,7 +75,7 @@ add_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
/* Then copy our new field at this new location */
retval = TSMimeHdrFieldCopy(req_bufp, req_loc, new_field_loc, hdr_bufp, hdr_loc, field_loc);
if (retval == TS_ERROR) {
- TSError("[add_header] Error while copying new field");
+ TSError("[add_header] Unable to copy new field");
TSHandleMLocRelease(hdr_bufp, hdr_loc, field_loc);
break;
}
@@ -83,7 +83,7 @@ add_header(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
/* Add this field to the Http client request header */
retval = TSMimeHdrFieldAppend(req_bufp, req_loc, new_field_loc);
if (retval != TS_SUCCESS) {
- TSError("[add_header] Error while appending new field");
+ TSError("[add_header] Unable to append new field");
TSHandleMLocRelease(hdr_bufp, hdr_loc, field_loc);
break;
}
@@ -132,30 +132,30 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[PluginInit] Plugin registration failed.\n");
+ TSError("[add_header] Plugin registration failed.");
goto error;
}
if (argc < 2) {
- TSError("[PluginInit] Usage: %s \"name1: value1\" \"name2: value2\" ...>\n", argv[0]);
+ TSError("[add_header] Usage: %s \"name1: value1\" \"name2: value2\" ...>", argv[0]);
goto error;
}
hdr_bufp = TSMBufferCreate();
if (TSMimeHdrCreate(hdr_bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("[PluginInit] Can not create mime header");
+ TSError("[add_header] Can not create mime header");
goto error;
}
for (i = 1; i < argc; i++) {
if (TSMimeHdrFieldCreate(hdr_bufp, hdr_loc, &field_loc) != TS_SUCCESS) {
- TSError("[PluginInit] Error while creating field");
+ TSError("[add_header] Unable to create field");
goto error;
}
retval = TSMimeHdrFieldAppend(hdr_bufp, hdr_loc, field_loc);
if (retval != TS_SUCCESS) {
- TSError("[PluginInit] Error while adding field");
+ TSError("[add_header] Unable to add field");
goto error;
}
@@ -163,7 +163,7 @@ TSPluginInit(int argc, const char *argv[])
if (p) {
retval = TSMimeHdrFieldNameSet(hdr_bufp, hdr_loc, field_loc, argv[i], p - argv[i]);
if (retval == TS_ERROR) {
- TSError("[PluginInit] Error while naming field");
+ TSError("[add_header] Unable to name field");
goto error;
}
@@ -173,13 +173,13 @@ TSPluginInit(int argc, const char *argv[])
}
retval = TSMimeHdrFieldValueStringInsert(hdr_bufp, hdr_loc, field_loc, -1, p, strlen(p));
if (retval == TS_ERROR) {
- TSError("[PluginInit] Error while inserting field value");
+ TSError("[add_header] Unable to insert field value");
goto error;
}
} else {
retval = TSMimeHdrFieldNameSet(hdr_bufp, hdr_loc, field_loc, argv[i], strlen(argv[i]));
if (retval == TS_ERROR) {
- TSError("[PluginInit] Error while inserting field value");
+ TSError("[add_header] Unable to set field name");
goto error;
}
}
@@ -191,7 +191,7 @@ TSPluginInit(int argc, const char *argv[])
goto done;
error:
- TSError("[PluginInit] Plugin not initialized");
+ TSError("[add_header] Plugin not initialized");
done:
return;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/append-transform/append-transform.c
----------------------------------------------------------------------
diff --git a/example/append-transform/append-transform.c b/example/append-transform/append-transform.c
index 6463556..386ece5 100644
--- a/example/append-transform/append-transform.c
+++ b/example/append-transform/append-transform.c
@@ -353,17 +353,17 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[append-transform] Plugin registration failed.");
goto Lerror;
}
if (argc != 2) {
- TSError("usage: %s <filename>\n", argv[0]);
+ TSError("[append-transform] Usage: %s <filename>", argv[0]);
goto Lerror;
}
if (!load(argv[1])) {
- TSError("[append-transform] Could not load %s\n", argv[1]);
+ TSError("[append-transform] Could not load %s", argv[1]);
goto Lerror;
}
@@ -372,5 +372,5 @@ TSPluginInit(int argc, const char *argv[])
Lerror:
- TSError("[append-transform] Unable to initialize plugin\n");
+ TSError("[append-transform] Unable to initialize plugin");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/basic-auth/basic-auth.c
----------------------------------------------------------------------
diff --git a/example/basic-auth/basic-auth.c b/example/basic-auth/basic-auth.c
index 2a95963..3afb8cd 100644
--- a/example/basic-auth/basic-auth.c
+++ b/example/basic-auth/basic-auth.c
@@ -97,20 +97,20 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
int authval_length;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[basic_auth] Couldn't retrieve client request header");
goto done;
}
field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, TS_MIME_FIELD_PROXY_AUTHORIZATION, TS_MIME_LEN_PROXY_AUTHORIZATION);
if (!field_loc) {
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
- TSError("no Proxy-Authorization field\n");
+ TSError("[basic_auth] No Proxy-Authorization field");
goto done;
}
val = TSMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, -1, &authval_length);
if (NULL == val) {
- TSError("no value in Proxy-Authorization field\n");
+ TSError("[basic_auth] No value in Proxy-Authorization field");
TSHandleMLocRelease(bufp, hdr_loc, field_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -118,7 +118,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
ptr = val;
if (strncmp(ptr, "Basic", 5) != 0) {
- TSError("no Basic auth type in Proxy-Authorization\n");
+ TSError("[basic_auth] No Basic auth type in Proxy-Authorization");
TSHandleMLocRelease(bufp, hdr_loc, field_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -132,7 +132,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
user = base64_decode(ptr);
password = strchr(user, ':');
if (!password) {
- TSError("no password in authorization information\n");
+ TSError("[basic_auth] No password in authorization information");
TSfree(user);
TSHandleMLocRelease(bufp, hdr_loc, field_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
@@ -142,7 +142,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
password += 1;
if (!authorized(user, password)) {
- TSError("%s:%s not authorized\n", user, password);
+ TSError("[basic_auth] %s:%s not authorized", user, password);
TSfree(user);
TSHandleMLocRelease(bufp, hdr_loc, field_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
@@ -170,7 +170,7 @@ handle_response(TSHttpTxn txnp)
int len = strlen(insert);
if (TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client response header\n");
+ TSError("[basic_auth] Couldn't retrieve client response header");
goto done;
}
@@ -220,7 +220,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[basic_auth] Plugin registration failed.");
}
/* Build translation table */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/blacklist-0/blacklist-0.c
----------------------------------------------------------------------
diff --git a/example/blacklist-0/blacklist-0.c b/example/blacklist-0/blacklist-0.c
index 1205d60..51850c5 100644
--- a/example/blacklist-0/blacklist-0.c
+++ b/example/blacklist-0/blacklist-0.c
@@ -48,19 +48,19 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
int host_length;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[blacklist-0] Couldn't retrieve client request header");
goto done;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[blacklist-0] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
host = TSUrlHostGet(bufp, url_loc, &host_length);
if (!host) {
- TSError("couldn't retrieve request hostname\n");
+ TSError("[blacklist-0] Couldn't retrieve request hostname");
TSHandleMLocRelease(bufp, hdr_loc, url_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -93,7 +93,7 @@ handle_response(TSHttpTxn txnp)
int url_length;
if (TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client response header\n");
+ TSError("[blacklist-0] Couldn't retrieve client response header");
goto done;
}
@@ -102,13 +102,13 @@ handle_response(TSHttpTxn txnp)
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[blacklist-0] Couldn't retrieve client request header");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
if (!TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[blacklist-0] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
@@ -156,7 +156,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[blacklist-0] Plugin registration failed.");
}
nsites = argc - 1;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/blacklist-1/blacklist-1.c
----------------------------------------------------------------------
diff --git a/example/blacklist-1/blacklist-1.c b/example/blacklist-1/blacklist-1.c
index cdaf0b6..e1c499e 100644
--- a/example/blacklist-1/blacklist-1.c
+++ b/example/blacklist-1/blacklist-1.c
@@ -75,19 +75,19 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
int host_length;
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[blacklist-1] Couldn't retrieve client request header");
goto done;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[blacklist-1] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
host = TSUrlHostGet(bufp, url_loc, &host_length);
if (!host) {
- TSError("couldn't retrieve request hostname\n");
+ TSError("[blacklist-1] Couldn't retrieve request hostname");
TSHandleMLocRelease(bufp, hdr_loc, url_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -138,7 +138,7 @@ handle_response(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
int url_length;
if (TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client response header\n");
+ TSError("[blacklist-1] Couldn't retrieve client response header");
goto done;
}
@@ -147,13 +147,13 @@ handle_response(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[blacklist-1] Couldn't retrieve client request header");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[blacklist-1] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
@@ -214,8 +214,8 @@ read_blacklist(TSCont contp)
TSfclose(file);
} else {
- TSError("unable to open %s\n", blacklist_file);
- TSError("all sites will be allowed\n");
+ TSError("[blacklist-1] Unable to open %s", blacklist_file);
+ TSError("[blacklist-1] All sites will be allowed");
}
TSMutexUnlock(sites_mutex);
@@ -316,7 +316,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[blacklist-1] Plugin registration failed.");
}
/* create an TSTextLogObject to log blacklisted requests to */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/bnull-transform/bnull-transform.c
----------------------------------------------------------------------
diff --git a/example/bnull-transform/bnull-transform.c b/example/bnull-transform/bnull-transform.c
index 778a146..563bfc0 100644
--- a/example/bnull-transform/bnull-transform.c
+++ b/example/bnull-transform/bnull-transform.c
@@ -270,7 +270,7 @@ transformable(TSHttpTxn txnp)
if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) == TS_ERROR) {
TSError("[bnull-transform] Error releasing MLOC while checking "
- "header status\n");
+ "header status");
}
return retv;
@@ -316,7 +316,8 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[bnull-transform] Plugin registration failed.\n");
+ TSError("[bnull-transform] Plugin registration failed.");
+
goto Lerror;
}
@@ -327,5 +328,5 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
return;
Lerror:
- TSError("[bnull-transform] Plugin disabled\n");
+ TSError("[bnull-transform] Plugin disabled");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/cache-scan/cache-scan.cc
----------------------------------------------------------------------
diff --git a/example/cache-scan/cache-scan.cc b/example/cache-scan/cache-scan.cc
index ee1f04d..70e8d15 100644
--- a/example/cache-scan/cache-scan.cc
+++ b/example/cache-scan/cache-scan.cc
@@ -175,7 +175,7 @@ handle_scan(TSCont contp, TSEvent event, void *edata)
return TS_CACHE_SCAN_RESULT_DONE;
}
- TSError("Unknown event in handle_scan: %d", event);
+ TSError("[cache-scan] Unknown event in handle_scan: %d", event);
return -1;
}
@@ -233,7 +233,7 @@ cleanup(TSCont contp)
if (cstate->key_to_delete) {
if (TSCacheKeyDestroy(cstate->key_to_delete) == TS_ERROR) {
- TSError("failed to destroy cache key");
+ TSError("[cache-scan] Failed to destroy cache key");
}
cstate->key_to_delete = NULL;
}
@@ -331,7 +331,7 @@ cache_intercept(TSCont contp, TSEvent event, void *edata)
cleanup(contp);
return 0;
default:
- TSError("Unknown event in cache_intercept: %d", event);
+ TSError("[cache-scan] Unknown event in cache_intercept: %d", event);
cleanup(contp);
return 0;
}
@@ -387,13 +387,13 @@ setup_request(TSCont contp, TSHttpTxn txnp)
TSAssert(contp == global_contp);
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header");
+ TSError("[cache-scan] Couldn't retrieve client request header");
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
return TS_SUCCESS;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url");
+ TSError("[cache-scan] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
return TS_SUCCESS;
@@ -401,7 +401,7 @@ setup_request(TSCont contp, TSHttpTxn txnp)
path = TSUrlPathGet(bufp, url_loc, &path_len);
if (!path) {
- TSError("couldn't retrieve request path");
+ TSError("[cache-scan] Couldn't retrieve request path");
TSHandleMLocRelease(bufp, hdr_loc, url_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
@@ -441,7 +441,7 @@ setup_request(TSCont contp, TSHttpTxn txnp)
TSUrlCreate(urlBuf, &urlLoc);
if (TSUrlParse(urlBuf, urlLoc, (const char **)&start, end) != TS_PARSE_DONE ||
TSCacheKeyDigestFromUrlSet(cstate->key_to_delete, urlLoc) != TS_SUCCESS) {
- TSError("CacheKeyDigestFromUrlSet failed");
+ TSError("[cache-scan] CacheKeyDigestFromUrlSet failed");
TSCacheKeyDestroy(cstate->key_to_delete);
TSfree(cstate);
TSHandleMLocRelease(urlBuf, NULL, urlLoc);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/file-1/file-1.c
----------------------------------------------------------------------
diff --git a/example/file-1/file-1.c b/example/file-1/file-1.c
index 88fecdf..b671599 100644
--- a/example/file-1/file-1.c
+++ b/example/file-1/file-1.c
@@ -49,7 +49,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[file-1] Plugin registration failed.");
}
for (i = 1; i < argc; i++) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/hello/hello.c
----------------------------------------------------------------------
diff --git a/example/hello/hello.c b/example/hello/hello.c
index 5b248d7..94379e5 100644
--- a/example/hello/hello.c
+++ b/example/hello/hello.c
@@ -36,7 +36,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed. \n");
+ TSError("[hello-world] Plugin registration failed.");
}
TSDebug("debug-hello", "Hello World!\n");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/lifecycle-plugin/lifecycle-plugin.c
----------------------------------------------------------------------
diff --git a/example/lifecycle-plugin/lifecycle-plugin.c b/example/lifecycle-plugin/lifecycle-plugin.c
index f98ac02..5cda67b 100644
--- a/example/lifecycle-plugin/lifecycle-plugin.c
+++ b/example/lifecycle-plugin/lifecycle-plugin.c
@@ -89,13 +89,14 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[lifecycle-plugin] Plugin registration failed.\n");
+ TSError("[lifecycle-plugin] Plugin registration failed.");
+
goto Lerror;
}
if (!CheckVersion()) {
TSError("[lifecycle-plugin] Plugin requires Traffic Server 3.3.5 "
- "or later\n");
+ "or later");
goto Lerror;
}
@@ -110,5 +111,5 @@ TSPluginInit(int argc, const char *argv[])
return;
Lerror:
- TSError("[amc-tranform] Unable to initialize plugin (disabled).\n");
+ TSError("[lifecycle-plugin] Unable to initialize plugin (disabled).");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/null-transform/null-transform.c
----------------------------------------------------------------------
diff --git a/example/null-transform/null-transform.c b/example/null-transform/null-transform.c
index bbb428f..a4a5e72 100644
--- a/example/null-transform/null-transform.c
+++ b/example/null-transform/null-transform.c
@@ -265,7 +265,7 @@ transformable(TSHttpTxn txnp)
if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) == TS_ERROR) {
TSError("[null-transform] Error releasing MLOC while checking "
- "header status\n");
+ "header status");
}
TSDebug("null-transform", "Exiting transformable with return %d", retv);
@@ -314,7 +314,8 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[null-transform] Plugin registration failed.\n");
+ TSError("[null-transform] Plugin registration failed.");
+
goto Lerror;
}
@@ -322,5 +323,5 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
return;
Lerror:
- TSError("[null-tranform] Unable to initialize plugin (disabled).\n");
+ TSError("[null-transform] Unable to initialize plugin (disabled).");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/output-header/output-header.c
----------------------------------------------------------------------
diff --git a/example/output-header/output-header.c b/example/output-header/output-header.c
index b619396..90db3b6 100644
--- a/example/output-header/output-header.c
+++ b/example/output-header/output-header.c
@@ -59,7 +59,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
TSDebug(DEBUG_TAG, "couldn't retrieve client request header");
- TSError("couldn't retrieve client request header\n");
+ TSError("[output_header] Couldn't retrieve client request header");
goto done;
}
@@ -73,7 +73,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) == TS_ERROR) {
TSDebug(DEBUG_TAG, "non-fatal: error releasing MLoc");
- TSError("non-fatal: error releasing MLoc\n");
+ TSError("[output_header] non-fatal: Couldn't release MLoc");
}
/* Find out how the big the complete header is by
@@ -158,12 +158,13 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[PluginInit] Plugin registration failed.\n");
+ TSError("[output_header] Plugin registration failed.");
+
goto error;
}
TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(hdr_plugin, NULL));
error:
- TSError("[PluginInit] Plugin not initialized");
+ TSError("[output_header] Plugin not initialized");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/protocol/Protocol.c
----------------------------------------------------------------------
diff --git a/example/protocol/Protocol.c b/example/protocol/Protocol.c
index f2a2d5e..cf2e3b1 100644
--- a/example/protocol/Protocol.c
+++ b/example/protocol/Protocol.c
@@ -82,13 +82,13 @@ protocol_init(int accept_port, int server_port ATS_UNUSED)
/* create customized log */
ret_val = TSTextLogObjectCreate("protocol", TS_LOG_MODE_ADD_TIMESTAMP, &protocol_plugin_log);
if (ret_val != TS_SUCCESS) {
- TSError("failed to create log");
+ TSError("[protocol] Failed to create log");
}
/* format of the log entries, for caching_status, 1 for HIT and 0 for MISS */
ret_val = TSTextLogObjectWrite(protocol_plugin_log, "timestamp filename servername caching_status\n\n");
if (ret_val != TS_SUCCESS) {
- TSError("failed to write into log");
+ TSError("[protocol] Failed to write into log");
}
contp = TSContCreate(accept_handler, TSMutexCreate());
@@ -112,7 +112,8 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[PluginInit] Plugin registration failed.\n");
+ TSError("[protocol] Plugin registration failed.");
+
goto error;
}
@@ -150,5 +151,5 @@ TSPluginInit(int argc, const char *argv[])
protocol_init(accept_port, server_port);
error:
- TSError("[PluginInit] Plugin not initialized");
+ TSError("[protocol] Plugin not initialized");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/protocol/TxnSM.c
----------------------------------------------------------------------
diff --git a/example/protocol/TxnSM.c b/example/protocol/TxnSM.c
index d9c2b29..8aff655 100644
--- a/example/protocol/TxnSM.c
+++ b/example/protocol/TxnSM.c
@@ -274,7 +274,7 @@ state_handle_cache_lookup(TSCont contp, TSEvent event, TSVConn vc)
/* Write log */
ret_val = TSTextLogObjectWrite(protocol_plugin_log, "%s %s %d \n", txn_sm->q_file_name, txn_sm->q_server_name, 1);
if (ret_val != TS_SUCCESS)
- TSError("fail to write into log");
+ TSError("[protocol] Fail to write into log");
txn_sm->q_cache_vc = vc;
txn_sm->q_pending_action = NULL;
@@ -306,7 +306,7 @@ state_handle_cache_lookup(TSCont contp, TSEvent event, TSVConn vc)
ret_val = TSTextLogObjectWrite(protocol_plugin_log, "%s %s %d \n", txn_sm->q_file_name, txn_sm->q_server_name, 0);
if (ret_val != TS_SUCCESS)
- TSError("fail to write into log");
+ TSError("[protocol] Fail to write into log");
set_handler(txn_sm->q_current_handler, (TxnSMHandler)&state_handle_cache_prepare_for_write);
txn_sm->q_pending_action = TSCacheWrite(contp, txn_sm->q_key);
@@ -409,7 +409,7 @@ state_handle_cache_prepare_for_write(TSCont contp, TSEvent event, TSVConn vc)
txn_sm->q_cache_vc = vc;
break;
default:
- TSError("can't open cache write_vc, aborting txn");
+ TSError("[protocol] Can't open cache write_vc, aborting txn");
txn_sm->q_cache_vc = NULL;
return prepare_to_die(contp);
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/query-remap/query-remap.c
----------------------------------------------------------------------
diff --git a/example/query-remap/query-remap.c b/example/query-remap/query-remap.c
index 6f5b0c8..ec6249f 100644
--- a/example/query-remap/query-remap.c
+++ b/example/query-remap/query-remap.c
@@ -59,7 +59,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf ATS_UNUSED, i
TSDebug(PLUGIN_NAME, "new instance fromURL: %s toURL: %s", argv[0], argv[1]);
if (argc < 4) {
- TSError("Missing parameters for " PLUGIN_NAME);
+ TSError("[query_remap] Missing parameters");
return -1;
}
@@ -118,7 +118,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh ATS_UNUSED, TSRemapRequestInfo *rri)
query_remap_info *qri = (query_remap_info *)ih;
if (!qri || !rri) {
- TSError(PLUGIN_NAME "NULL private data or RRI");
+ TSError("[query_remap] NULL private data or RRI");
return TSREMAP_NO_REMAP;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/redirect-1/redirect-1.c
----------------------------------------------------------------------
diff --git a/example/redirect-1/redirect-1.c b/example/redirect-1/redirect-1.c
index d36f164..afedb06 100644
--- a/example/redirect-1/redirect-1.c
+++ b/example/redirect-1/redirect-1.c
@@ -139,19 +139,19 @@ handle_client_lookup(TSHttpTxn txnp, TSCont contp)
}
if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client request header\n");
+ TSError("[redirect-1] Couldn't retrieve client request header");
goto done;
}
if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve request url\n");
+ TSError("[redirect-1] Couldn't retrieve request url");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
}
host = TSUrlHostGet(bufp, url_loc, &host_length);
if (!host) {
- TSError("couldn't retrieve request hostname\n");
+ TSError("[redirect-1] Couldn't retrieve request hostname");
TSHandleMLocRelease(bufp, hdr_loc, url_loc);
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
goto done;
@@ -207,7 +207,7 @@ handle_response(TSHttpTxn txnp)
char *tmp_body;
if (TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve client response header\n");
+ TSError("[redirect-1] Couldn't retrieve client response header");
goto done;
}
@@ -346,7 +346,7 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[redirect-1] Plugin registration failed.");
}
if (argc == 3) {
@@ -363,7 +363,7 @@ TSPluginInit(int argc, const char *argv[])
TSstrlcat(uri_redirect, url_redirect, uri_len);
} else {
- TSError("Incorrect syntax in plugin.conf: correct usage is"
+ TSError("[redirect-1] Incorrect syntax in plugin.conf: correct usage is"
"redirect-1.so ip_deny url_redirect");
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/remap/remap.cc
----------------------------------------------------------------------
diff --git a/example/remap/remap.cc b/example/remap/remap.cc
index fcf465b..931ba11 100644
--- a/example/remap/remap.cc
+++ b/example/remap/remap.cc
@@ -146,7 +146,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = (char *)"";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed. \n");
+ TSError("[remap] Plugin registration failed.");
}
TSDebug("debug-remap", "TSPluginInit: Remap plugin started\n");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/remap_header_add/remap_header_add.cc
----------------------------------------------------------------------
diff --git a/example/remap_header_add/remap_header_add.cc b/example/remap_header_add/remap_header_add.cc
index 503089e..5e61929 100644
--- a/example/remap_header_add/remap_header_add.cc
+++ b/example/remap_header_add/remap_header_add.cc
@@ -96,7 +96,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, NOWARN_UNUSED char *errbuf
TSDebug(TAG, "TSRemapNewInstance()");
if (!argv || !ih) {
- TSError(TAG ": Unable to load plugin because missing argv or ih.");
+ TSError("[remap_header_add] Unable to load plugin because missing argv or ih.");
return TS_ERROR;
}
@@ -147,7 +147,7 @@ TSRemapDoRemap(void *ih, NOWARN_UNUSED TSHttpTxn txn, NOWARN_UNUSED TSRemapReque
remap_line *rl = (remap_line *)ih;
if (!rl || !rri) {
- TSError(TAG ": rl or rri is null.");
+ TSError("[remap_header_add] rl or rri is null.");
return TSREMAP_NO_REMAP;
}
@@ -156,7 +156,7 @@ TSRemapDoRemap(void *ih, NOWARN_UNUSED TSHttpTxn txn, NOWARN_UNUSED TSRemapReque
TSMBuffer req_bufp;
TSMLoc req_loc;
if (TSHttpTxnClientReqGet(txn, &req_bufp, &req_loc) != TS_SUCCESS) {
- TSError(TAG ": Error while retrieving client request header");
+ TSError("[remap_header_add] Error while retrieving client request header");
return TSREMAP_NO_REMAP;
}
@@ -169,7 +169,7 @@ TSRemapDoRemap(void *ih, NOWARN_UNUSED TSHttpTxn txn, NOWARN_UNUSED TSRemapReque
TSMimeHdrFieldAppend(req_bufp, req_loc, field_loc);
TSMimeHdrFieldValueStringInsert(req_bufp, req_loc, field_loc, 0, rl->val[i], strlen(rl->val[i]));
} else {
- TSError(TAG ": Failure on TSMimeHdrFieldCreate");
+ TSError("[remap_header_add] Failure on TSMimeHdrFieldCreate");
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/replace-header/replace-header.c
----------------------------------------------------------------------
diff --git a/example/replace-header/replace-header.c b/example/replace-header/replace-header.c
index 8eb2622..189e1f8 100644
--- a/example/replace-header/replace-header.c
+++ b/example/replace-header/replace-header.c
@@ -47,7 +47,7 @@ replace_header(TSHttpTxn txnp)
TSMLoc field_loc;
if (TSHttpTxnServerRespGet(txnp, &resp_bufp, &resp_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve server response header.\n");
+ TSError("[replace_header] Couldn't retrieve server response header.");
goto done;
}
@@ -103,7 +103,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed. \n");
+ TSError("[replace_header] Plugin registration failed.");
}
TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, TSContCreate(replace_header_plugin, NULL));
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/response-header-1/response-header-1.c
----------------------------------------------------------------------
diff --git a/example/response-header-1/response-header-1.c b/example/response-header-1/response-header-1.c
index 04e0c7e..016a20c 100644
--- a/example/response-header-1/response-header-1.c
+++ b/example/response-header-1/response-header-1.c
@@ -88,7 +88,7 @@ modify_header(TSHttpTxn txnp)
return; /* caller reenables */
if (TSHttpTxnServerRespGet(txnp, &resp_bufp, &resp_loc) != TS_SUCCESS) {
- TSError("couldn't retrieve server response header\n");
+ TSError("[response_header-1] Couldn't retrieve server response header");
return; /* caller reenables */
}
@@ -136,8 +136,8 @@ modify_header(TSHttpTxn txnp)
/* Get the cached HTTP header */
if (TSHttpTxnCachedRespGet(txnp, &cached_bufp, &cached_loc) != TS_SUCCESS) {
- TSError("STATUS 304, TSHttpTxnCachedRespGet():");
- TSError("couldn't retrieve cached response header\n");
+ TSError("[response_header-1] STATUS 304, TSHttpTxnCachedRespGet():");
+ TSError("[response_header-1] Couldn't retrieve cached response header");
TSHandleMLocRelease(resp_bufp, TS_NULL_MLOC, resp_loc);
return; /* Caller reenables */
}
@@ -145,7 +145,7 @@ modify_header(TSHttpTxn txnp)
/* Get the cached MIME field name for this HTTP header */
cached_field_loc = TSMimeHdrFieldFind(cached_bufp, cached_loc, (const char *)mimehdr1_name, strlen(mimehdr1_name));
if (TS_NULL_MLOC == cached_field_loc) {
- TSError("Can't find header %s in cached document", mimehdr1_name);
+ TSError("[response_header-1] Can't find header %s in cached document", mimehdr1_name);
TSHandleMLocRelease(resp_bufp, TS_NULL_MLOC, resp_loc);
TSHandleMLocRelease(cached_bufp, TS_NULL_MLOC, cached_loc);
return; /* Caller reenables */
@@ -154,7 +154,7 @@ modify_header(TSHttpTxn txnp)
/* Get the cached MIME value for this name in this HTTP header */
chkptr = TSMimeHdrFieldValueStringGet(cached_bufp, cached_loc, cached_field_loc, -1, &chklength);
if (NULL == chkptr || !chklength) {
- TSError("Could not find value for cached MIME field name %s", mimehdr1_name);
+ TSError("[response_header-1] Could not find value for cached MIME field name %s", mimehdr1_name);
TSHandleMLocRelease(resp_bufp, TS_NULL_MLOC, resp_loc);
TSHandleMLocRelease(cached_bufp, TS_NULL_MLOC, cached_loc);
TSHandleMLocRelease(cached_bufp, cached_loc, cached_field_loc);
@@ -239,14 +239,14 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[response_header-1] Plugin registration failed.");
}
init_buffer_status = 0;
if (argc > 1) {
- TSError("usage: %s \n", argv[0]);
- TSError("warning: too many args %d\n", argc);
- TSError("warning: ignoring unused arguments beginning with %s\n", argv[1]);
+ TSError("[response_header-1] usage: %s", argv[0]);
+ TSError("[response_header-1] warning: too many args %d", argc);
+ TSError("[response_header-1] warning: ignoring unused arguments beginning with %s", argv[1]);
}
/*
@@ -287,12 +287,12 @@ TSPluginInit(int argc, const char *argv[])
*/
if (TS_NULL_MLOC == (chk_field_loc = TSMimeHdrFieldGet(hdr_bufp, hdr_loc, 0))) {
- TSError("couldn't retrieve header field from init buffer");
- TSError("marking init buffer as corrupt; no more plugin processing");
+ TSError("[response_header-1] Couldn't retrieve header field from init buffer");
+ TSError("[response_header-1] Marking init buffer as corrupt; no more plugin processing");
init_buffer_status = 0;
/* bail out here and reenable transaction */
} else {
if (field_loc != chk_field_loc)
- TSError("retrieved buffer field loc is %p when it should be %p", chk_field_loc, field_loc);
+ TSError("[response_header-1] Retrieved buffer field loc is %p when it should be %p", chk_field_loc, field_loc);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/secure-link/secure-link.c
----------------------------------------------------------------------
diff --git a/example/secure-link/secure-link.c b/example/secure-link/secure-link.c
index 04da8b3..3e6646f 100644
--- a/example/secure-link/secure-link.c
+++ b/example/secure-link/secure-link.c
@@ -72,19 +72,19 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
expire = TSstrdup(val);
}
} else {
- TSError("Invalid parameter [%s]", ptr);
+ TSError("[secure_link] Invalid parameter [%s]", ptr);
break;
}
} while ((ptr = strtok_r(NULL, "&", &saveptr)) != NULL);
} else {
- TSError("strtok didn't find a & in the query string");
+ TSError("[secure_link] strtok didn't find a & in the query string");
/* this is just example, so set fake params to prevent plugin crash */
token = TSstrdup("d41d8cd98f00b204e9800998ecf8427e");
expire = TSstrdup("00000000");
}
TSfree(s);
} else {
- TSError("TSUrlHttpQueryGet returns empty value");
+ TSError("[secure_link] TSUrlHttpQueryGet returns empty value");
}
ph = TSUrlPathGet(rri->requestBufp, rri->requestUrl, &len);
@@ -96,7 +96,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
path = TSstrdup(s);
TSfree(s);
} else {
- TSError("TSUrlPathGet returns empty value");
+ TSError("[secure_link] TSUrlPathGet returns empty value");
/* this is just example, so set fake params to prevent plugin crash */
path = TSstrdup("example/");
}
@@ -172,7 +172,7 @@ TSRemapNewInstance(int argc, char **argv, void **ih, char *errbuf, int errbuf_si
TSDebug(PLUGIN_NAME, "Unknown parameter [%s]", argv[i]);
}
} else {
- TSError("Invalid parameter [%s]", argv[i]);
+ TSError("[secure_link] Invalid parameter [%s]", argv[i]);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/server-transform/server-transform.c
----------------------------------------------------------------------
diff --git a/example/server-transform/server-transform.c b/example/server-transform/server-transform.c
index c802a58..c3fef62 100644
--- a/example/server-transform/server-transform.c
+++ b/example/server-transform/server-transform.c
@@ -137,7 +137,7 @@ transform_destroy(TSCont contp)
TSfree(data);
} else {
- TSError("Unable to get Continuation's Data. TSContDataGet returns NULL");
+ TSError("[server_transform] Unable to get Continuation's Data. TSContDataGet returns NULL");
}
TSContDestroy(contp);
@@ -179,7 +179,7 @@ transform_connect(TSCont contp, TransformData *data)
data->input_reader = tempReader;
}
} else {
- TSError("TSIOBufferReaderAvail returns TS_ERROR");
+ TSError("[server_transform] TSIOBufferReaderAvail returns TS_ERROR");
return 0;
}
@@ -210,7 +210,7 @@ transform_write(TSCont contp, TransformData *data)
if (content_length >= 0) {
data->server_vio = TSVConnWrite(data->server_vc, contp, TSIOBufferReaderClone(data->input_reader), content_length);
} else {
- TSError("TSIOBufferReaderAvail returns TS_ERROR");
+ TSError("[server_transform] TSIOBufferReaderAvail returns TS_ERROR");
}
return 0;
}
@@ -225,7 +225,7 @@ transform_read_status(TSCont contp, TransformData *data)
if (data->output_reader != NULL) {
data->server_vio = TSVConnRead(data->server_vc, contp, data->output_buf, sizeof(int));
} else {
- TSError("Error in Allocating a Reader to output buffer. TSIOBufferReaderAlloc returns NULL");
+ TSError("[server_transform] Error in Allocating a Reader to output buffer. TSIOBufferReaderAlloc returns NULL");
}
return 0;
@@ -243,11 +243,11 @@ transform_read(TSCont contp, TransformData *data)
data->server_vio = TSVConnRead(data->server_vc, contp, data->output_buf, data->content_length);
data->output_vc = TSTransformOutputVConnGet((TSVConn)contp);
if (data->output_vc == NULL) {
- TSError("TSTransformOutputVConnGet returns NULL");
+ TSError("[server_transform] TSTransformOutputVConnGet returns NULL");
} else {
data->output_vio = TSVConnWrite(data->output_vc, contp, data->output_reader, data->content_length);
if (data->output_vio == NULL) {
- TSError("TSVConnWrite returns NULL");
+ TSError("[server_transform] TSVConnWrite returns NULL");
}
}
@@ -274,11 +274,11 @@ transform_bypass(TSCont contp, TransformData *data)
TSIOBufferReaderConsume(data->input_reader, sizeof(int));
data->output_vc = TSTransformOutputVConnGet((TSVConn)contp);
if (data->output_vc == NULL) {
- TSError("TSTransformOutputVConnGet returns NULL");
+ TSError("[server_transform] TSTransformOutputVConnGet returns NULL");
} else {
data->output_vio = TSVConnWrite(data->output_vc, contp, data->input_reader, TSIOBufferReaderAvail(data->input_reader));
if (data->output_vio == NULL) {
- TSError("TSVConnWrite returns NULL");
+ TSError("[server_transform] TSVConnWrite returns NULL");
}
}
return 1;
@@ -515,7 +515,7 @@ transform_handler(TSCont contp, TSEvent event, void *edata)
data = (TransformData *)TSContDataGet(contp);
if (data == NULL) {
- TSError("Didn't get Continuation's Data. Ignoring Event..");
+ TSError("[server_transform] Didn't get Continuation's Data. Ignoring Event..");
return 0;
}
TSDebug("strans", "transform handler event [%d], data->state = [%d]", event, data->state);
@@ -583,19 +583,19 @@ server_response_ok(TSHttpTxn txnp)
TSHttpStatus resp_status;
if (TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("Unable to get handle to Server Response");
+ TSError("[server_transform] Unable to get handle to Server Response");
return 0;
}
resp_status = TSHttpHdrStatusGet(bufp, hdr_loc);
if (TS_HTTP_STATUS_OK == resp_status) {
if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) != TS_SUCCESS) {
- TSError("Unable to release handle to server request");
+ TSError("[server_transform] Unable to release handle to server request");
}
return 1;
} else {
if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) != TS_SUCCESS) {
- TSError("Unable to release handle to server request");
+ TSError("[server_transform] Unable to release handle to server request");
}
return 0;
}
@@ -643,7 +643,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[server_transform] Plugin registration failed.");
}
/* connect to the echo port on localhost */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/session-1/session-1.c
----------------------------------------------------------------------
diff --git a/example/session-1/session-1.c b/example/session-1/session-1.c
index 201cd27..8f51c8a 100644
--- a/example/session-1/session-1.c
+++ b/example/session-1/session-1.c
@@ -98,7 +98,8 @@ TSPluginInit(int argc, const char *argv[])
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("[PluginInit] Plugin registration failed.\n");
+ TSError("[session-1] Plugin registration failed.\n");
+
goto error;
}
@@ -110,5 +111,5 @@ TSPluginInit(int argc, const char *argv[])
TSHttpHookAdd(TS_HTTP_SSN_START_HOOK, contp);
error:
- TSError("[PluginInit] Plugin not initialized");
+ TSError("[session-1] Plugin not initialized");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/thread-1/thread-1.c
----------------------------------------------------------------------
diff --git a/example/thread-1/thread-1.c b/example/thread-1/thread-1.c
index a29678b..a9be7f5 100644
--- a/example/thread-1/thread-1.c
+++ b/example/thread-1/thread-1.c
@@ -75,7 +75,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[thread-1] Plugin registration failed.");
}
TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(thread_plugin, NULL));
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/thread-pool/psi.c
----------------------------------------------------------------------
diff --git a/example/thread-pool/psi.c b/example/thread-pool/psi.c
index 9a47ef0..f924659 100644
--- a/example/thread-pool/psi.c
+++ b/example/thread-pool/psi.c
@@ -897,7 +897,7 @@ transformable(TSHttpTxn txnp)
field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, TS_MIME_FIELD_CONTENT_TYPE, -1);
if (field_loc == TS_NULL_MLOC) {
- TSError("[transformable] Error while searching Content-Type field");
+ TSError("[psi] Unable to search Content-Type field");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
return 0;
}
@@ -998,7 +998,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed.\n");
+ TSError("[psi] Plugin registration failed.");
}
/* Initialize the psi directory = <plugin_path>/include */
@@ -1007,7 +1007,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
/* create an TSTextLogObject to log any psi include */
retval = TSTextLogObjectCreate("psi", TS_LOG_MODE_ADD_TIMESTAMP, &log);
if (retval == TS_ERROR) {
- TSError("Failed creating log for psi plugin");
+ TSError("[psi] Failed creating log for psi plugin");
log = NULL;
}
@@ -1019,7 +1019,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
char *thread_name = (char *)TSmalloc(64);
sprintf(thread_name, "Thread[%d]", i);
if (!TSThreadCreate((TSThreadFunc)thread_loop, thread_name)) {
- TSError("[TSPluginInit] Error while creating threads");
+ TSError("[psi] Failed creating threads");
return;
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/thread-pool/thread.c
----------------------------------------------------------------------
diff --git a/example/thread-pool/thread.c b/example/thread-pool/thread.c
index 702676f..544c6b2 100644
--- a/example/thread-pool/thread.c
+++ b/example/thread-pool/thread.c
@@ -79,7 +79,7 @@ add_to_queue(Queue *q, void *data)
TSMutexUnlock(q->mutex);
if (n > MAX_JOBS_ALARM) {
- TSError("Warning:Too many jobs in plugin thread pool queue (%d). Maximum allowed is %d", n, MAX_JOBS_ALARM);
+ TSError("[thread_pool] Warning:Too many jobs in plugin thread pool queue (%d). Maximum allowed is %d", n, MAX_JOBS_ALARM);
}
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/example/version/version.c
----------------------------------------------------------------------
diff --git a/example/version/version.c b/example/version/version.c
index 292a090..ee249b9 100644
--- a/example/version/version.c
+++ b/example/version/version.c
@@ -35,7 +35,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
const char *ts_version = TSTrafficServerVersionGet();
if (!ts_version) {
- TSError("Can't get Traffic Server verion.\n");
+ TSError("[version] Can't get Traffic Server verion.\n");
return;
}
@@ -45,7 +45,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
int patch_ts_version = 0;
if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, &patch_ts_version) != 3) {
- TSError("Can't extract verions.\n");
+ TSError("[version] Can't extract verions.\n");
return;
}
@@ -54,8 +54,16 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
info.support_email = "ts-api-support@MyCompany.com";
+// 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
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Plugin registration failed. \n");
+#endif
+ TSError("[version] Plugin registration failed. \n");
+
}
TSDebug("debug-version-plugin", "Running in Apache Traffic Server: v%d.%d.%d\n", major_ts_version, minor_ts_version,
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/cacheurl/cacheurl.cc
----------------------------------------------------------------------
diff --git a/plugins/cacheurl/cacheurl.cc b/plugins/cacheurl/cacheurl.cc
index 6cfef24..2c3d96b 100644
--- a/plugins/cacheurl/cacheurl.cc
+++ b/plugins/cacheurl/cacheurl.cc
@@ -87,7 +87,7 @@ regex_substitute(char **buf, char *str, regex_info *info)
case PCRE_ERROR_NOMATCH:
break;
default:
- TSError("[%s] Matching error: %d\n", PLUGIN_NAME, matchcount);
+ TSError("[%s] Matching error: %d", PLUGIN_NAME, matchcount);
break;
}
return 0;
@@ -96,7 +96,7 @@ regex_substitute(char **buf, char *str, regex_info *info)
/* Verify the replacement has the right number of matching groups */
for (i = 0; i < info->tokcount; i++) {
if (info->tokens[i] >= matchcount) {
- TSError("[%s] Invalid reference int replacement: $%d\n", PLUGIN_NAME, info->tokens[i]);
+ TSError("[%s] Invalid reference int replacement: $%d", PLUGIN_NAME, info->tokens[i]);
return 0;
}
}
@@ -143,7 +143,7 @@ regex_compile(regex_info **buf, char *pattern, char *replacement)
/* Precompile the regular expression */
info->re = pcre_compile(pattern, 0, &reerror, &reerroffset, NULL);
if (!info->re) {
- TSError("[%s] Compilation of regex '%s' failed at char %d: %s\n", PLUGIN_NAME, pattern, reerroffset, reerror);
+ TSError("[%s] Compilation of regex '%s' failed at char %d: %s", PLUGIN_NAME, pattern, reerroffset, reerror);
status = 0;
}
@@ -156,12 +156,12 @@ regex_compile(regex_info **buf, char *pattern, char *replacement)
if (replacement[i] == '$') {
if (tokcount >= TOKENCOUNT) {
TSError("[%s] Error: too many tokens in replacement "
- "string: %s\n",
+ "string: %s",
PLUGIN_NAME, replacement);
status = 0;
break;
} else if (replacement[i + 1] < '0' || replacement[i + 1] > '9') {
- TSError("[%s] Error: Invalid replacement token $%c in %s: should be $0 - $9\n", PLUGIN_NAME, replacement[i + 1],
+ TSError("[%s] Error: Invalid replacement token $%c in %s: should be $0 - $9", PLUGIN_NAME, replacement[i + 1],
replacement);
status = 0;
break;
@@ -231,7 +231,7 @@ load_config_file(const char *config_file)
fh = TSfopen(path.c_str(), "r");
if (!fh) {
- TSError("[%s] Unable to open %s. No patterns will be loaded\n", PLUGIN_NAME, path.c_str());
+ TSError("[%s] Unable to open %s. No patterns will be loaded", PLUGIN_NAME, path.c_str());
return NULL;
}
@@ -261,7 +261,7 @@ load_config_file(const char *config_file)
spstart = strstr(buffer, "\t");
}
if (!spstart) {
- TSError("[%s] ERROR: Invalid format on line %d. Skipping\n", PLUGIN_NAME, lineno);
+ TSError("[%s] ERROR: Invalid format on line %d. Skipping", PLUGIN_NAME, lineno);
TSfclose(fh);
return NULL;
}
@@ -272,7 +272,7 @@ load_config_file(const char *config_file)
}
if (*spend == 0) {
/* We reached the end of the string without any non-whitepace */
- TSError("[%s] ERROR: Invalid format on line %d. Skipping\n", PLUGIN_NAME, lineno);
+ TSError("[%s] ERROR: Invalid format on line %d. Skipping", PLUGIN_NAME, lineno);
TSfclose(fh);
return NULL;
}
@@ -284,7 +284,7 @@ load_config_file(const char *config_file)
TSDebug(PLUGIN_NAME, "Adding pattern/replacement pair: '%s' -> '%s'", buffer, spend);
retval = regex_compile(&info, buffer, spend);
if (!retval) {
- TSError("[%s] Error precompiling regex/replacement. Skipping.\n", PLUGIN_NAME);
+ TSError("[%s] Error precompiling regex/replacement. Skipping.", PLUGIN_NAME);
TSfclose(fh);
return NULL;
}
@@ -294,7 +294,7 @@ load_config_file(const char *config_file)
TSfclose(fh);
if (prl->pr.empty()) {
- TSError("[%s] No regular expressions loaded.\n", PLUGIN_NAME);
+ TSError("[%s] No regular expressions loaded.", PLUGIN_NAME);
}
TSDebug(PLUGIN_NAME, "loaded %u regexes", (unsigned)prl->pr.size());
@@ -312,7 +312,7 @@ rewrite_cacheurl(pr_list *prl, TSHttpTxn txnp)
url = TSHttpTxnEffectiveUrlStringGet(txnp, &url_length);
if (!url) {
- TSError("[%s] couldn't retrieve request url\n", PLUGIN_NAME);
+ TSError("[%s] couldn't retrieve request url", PLUGIN_NAME);
ok = 0;
}
@@ -328,7 +328,7 @@ rewrite_cacheurl(pr_list *prl, TSHttpTxn txnp)
TSDebug(PLUGIN_NAME, "Rewriting cache URL for %s to %s", url, newurl);
if (TSCacheUrlSet(txnp, newurl, strlen(newurl)) != TS_SUCCESS) {
TSError("[%s] Unable to modify cache url from "
- "%s to %s\n",
+ "%s to %s",
PLUGIN_NAME, url, newurl);
ok = 0;
}
@@ -371,8 +371,8 @@ handle_hook(TSCont contp, TSEvent event, void *edata)
static void
initialization_error(const char *msg)
{
- TSError("[%s] %s\n", PLUGIN_NAME, msg);
- TSError("[%s] Unable to initialize plugin (disabled).\n", PLUGIN_NAME);
+ TSError("[%s] %s", PLUGIN_NAME, msg);
+ TSError("[%s] Unable to initialize plugin (disabled).", PLUGIN_NAME);
}
TSReturnCode
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/conf_remap/conf_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/conf_remap.cc b/plugins/conf_remap/conf_remap.cc
index a6281aa..ebf61b4 100644
--- a/plugins/conf_remap/conf_remap.cc
+++ b/plugins/conf_remap/conf_remap.cc
@@ -90,7 +90,7 @@ RemapConfigs::parse_inline(const char *arg)
value = std::string(sep + 1, std::distance(sep + 1, arg + strlen(arg)));
if (TSHttpTxnConfigFind(key.c_str(), -1 /* len */, &name, &type) != TS_SUCCESS) {
- TSError("%s: invalid configuration variable '%s'", PLUGIN_NAME, key.c_str());
+ TSError("[%s] Invalid configuration variable '%s'", PLUGIN_NAME, key.c_str());
return false;
}
@@ -108,7 +108,7 @@ RemapConfigs::parse_inline(const char *arg)
}
break;
default:
- TSError("%s: configuration variable '%s' is of an unsupported type", PLUGIN_NAME, key.c_str());
+ TSError("[%s] Configuration variable '%s' is of an unsupported type", PLUGIN_NAME, key.c_str());
return false;
}
@@ -144,7 +144,7 @@ RemapConfigs::parse_file(const char *filename)
}
if (NULL == (file = TSfopen(path.c_str(), "r"))) {
- TSError("%s: could not open config file %s", PLUGIN_NAME, path.c_str());
+ TSError("[%s] Could not open config file %s", PLUGIN_NAME, path.c_str());
return false;
}
@@ -164,26 +164,26 @@ RemapConfigs::parse_file(const char *filename)
continue;
if (strncmp(tok, "CONFIG", 6)) {
- TSError("%s: file %s, line %d: non-CONFIG line encountered", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] File %s, line %d: non-CONFIG line encountered", PLUGIN_NAME, path.c_str(), line_num);
continue;
}
// Find the configuration name
tok = strtok_r(NULL, " \t", &ln);
if (TSHttpTxnConfigFind(tok, -1, &name, &expected_type) != TS_SUCCESS) {
- TSError("%s: file %s, line %d: no records.config name given", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] File %s, line %d: no records.config name given", PLUGIN_NAME, path.c_str(), line_num);
continue;
}
// Find the type (INT or STRING only)
tok = strtok_r(NULL, " \t", &ln);
if (TS_RECORDDATATYPE_NULL == (type = str_to_datatype(tok))) {
- TSError("%s: file %s, line %d: only INT and STRING types supported", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] file %s, line %d: only INT and STRING types supported", PLUGIN_NAME, path.c_str(), line_num);
continue;
}
if (type != expected_type) {
- TSError("%s: file %s, line %d: mismatch between provide data type, and expected type", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] file %s, line %d: mismatch between provide data type, and expected type", PLUGIN_NAME, path.c_str(), line_num);
continue;
}
@@ -207,7 +207,7 @@ RemapConfigs::parse_file(const char *filename)
tok = NULL;
}
if (!tok) {
- TSError("%s: file %s, line %d: the configuration must provide a value", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] file %s, line %d: the configuration must provide a value", PLUGIN_NAME, path.c_str(), line_num);
continue;
}
@@ -226,7 +226,7 @@ RemapConfigs::parse_file(const char *filename)
}
break;
default:
- TSError("%s: file %s, line %d: type not support (unheard of)", PLUGIN_NAME, path.c_str(), line_num);
+ TSError("[%s] file %s, line %d: type not support (unheard of)", PLUGIN_NAME, path.c_str(), line_num);
continue;
break;
}
@@ -265,7 +265,7 @@ TSReturnCode
TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
{
if (argc < 3) {
- TSError("Unable to create remap instance, need configuration file");
+ TSError("[%s] Unable to create remap instance, need configuration file", PLUGIN_NAME);
return TS_ERROR;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_base_fetch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_base_fetch.cc b/plugins/experimental/ats_pagespeed/ats_base_fetch.cc
index b6463b8..eae2dca 100644
--- a/plugins/experimental/ats_pagespeed/ats_base_fetch.cc
+++ b/plugins/experimental/ats_pagespeed/ats_base_fetch.cc
@@ -179,7 +179,7 @@ AtsBaseFetch::HandleDone(bool success)
TSMBuffer reqp;
TSMLoc req_hdr_loc;
if (TSHttpTxnClientReqGet(ctx->txn, &reqp, &req_hdr_loc) != TS_SUCCESS) {
- TSError("Error TSHttpTxnClientReqGet for resource!");
+ TSError("[ats_base_fetch] Error TSHttpTxnClientReqGet for resource!");
ctx_ = NULL;
DecrefAndDeleteIfUnreferenced();
TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_beacon_intercept.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_beacon_intercept.cc b/plugins/experimental/ats_pagespeed/ats_beacon_intercept.cc
index c1bf3fb..05e2e8e 100644
--- a/plugins/experimental/ats_pagespeed/ats_beacon_intercept.cc
+++ b/plugins/experimental/ats_pagespeed/ats_beacon_intercept.cc
@@ -100,7 +100,7 @@ bool
InterceptCtx::init(TSVConn vconn)
{
if (initialized) {
- TSError("[%s] InterceptCtx already initialized!", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] InterceptCtx already initialized!", __FUNCTION__);
return false;
}
@@ -145,7 +145,7 @@ handleRead(InterceptCtx *cont_data, bool &read_complete)
{
int avail = TSIOBufferReaderAvail(cont_data->input.reader);
if (avail == TS_ERROR) {
- TSError("[%s] Error while getting number of bytes available", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Error while getting number of bytes available", __FUNCTION__);
return false;
}
@@ -185,7 +185,7 @@ handleRead(InterceptCtx *cont_data, bool &read_complete)
}
TSDebug(DEBUG_TAG, "[%s] Got content length as %d", __FUNCTION__, cont_data->req_content_len);
if (cont_data->req_content_len < 0) {
- TSError("[%s] Invalid content length [%d]", __FUNCTION__, cont_data->req_content_len);
+ TSError("[ats_beacon_intercept][%s] Invalid content length [%d]", __FUNCTION__, cont_data->req_content_len);
return false;
}
if (endptr - data) {
@@ -234,7 +234,7 @@ processRequest(InterceptCtx *cont_data)
string reply_header("HTTP/1.1 204 No Content\r\n");
int body_size = static_cast<int>(cont_data->body.size());
if (cont_data->req_content_len != body_size) {
- TSError("[%s] Read only %d bytes of body; expecting %d bytes", __FUNCTION__, body_size, cont_data->req_content_len);
+ TSError("[ats_beacon_intercept][%s] Read only %d bytes of body; expecting %d bytes", __FUNCTION__, body_size, cont_data->req_content_len);
}
char buf[64];
@@ -257,14 +257,14 @@ processRequest(InterceptCtx *cont_data)
if (!server_context->HandleBeacon(beacon_data, cont_data->request_context->user_agent->c_str(),
net_instaweb::RequestContextPtr(system_request_context))) {
- TSError("Beacon handling failure!");
+ TSError("[ats_beacon_intercept] Beacon handling failure!");
} else {
TSDebug(DEBUG_TAG, "Beacon post data processed OK: [%s]", beacon_data.c_str());
}
cont_data->setupWrite();
if (TSIOBufferWrite(cont_data->output.buffer, reply_header.data(), reply_header.size()) == TS_ERROR) {
- TSError("[%s] Error while writing reply header", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Error while writing reply header", __FUNCTION__);
return false;
}
/*
@@ -293,14 +293,14 @@ txn_intercept(TSCont contp, TSEvent event, void *edata)
TSDebug(DEBUG_TAG, "[%s] Received net accept event", __FUNCTION__);
TSAssert(cont_data->initialized == false);
if (!cont_data->init(static_cast<TSVConn>(edata))) {
- TSError("[%s] Could not initialize continuation data!", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Could not initialize continuation data!", __FUNCTION__);
return 1;
}
break;
case TS_EVENT_VCONN_READ_READY:
TSDebug(DEBUG_TAG, "[%s] Received read ready event", __FUNCTION__);
if (!handleRead(cont_data, read_complete)) {
- TSError("[%s] Error while reading from input vio", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Error while reading from input vio", __FUNCTION__);
// return 0;
read_complete = true;
}
@@ -321,7 +321,7 @@ txn_intercept(TSCont contp, TSEvent event, void *edata)
case TS_EVENT_ERROR:
// todo: do some error handling here
TSDebug(DEBUG_TAG, "[%s] Received error event; going to shutdown, event: %d", __FUNCTION__, event);
- TSError("[%s] Received error event; going to shutdown, event: %d", __FUNCTION__, event);
+ TSError("[ats_beacon_intercept][%s] Received error event; going to shutdown, event: %d", __FUNCTION__, event);
shutdown = true;
break;
default:
@@ -330,7 +330,7 @@ txn_intercept(TSCont contp, TSEvent event, void *edata)
if (read_complete) {
if (!processRequest(cont_data)) {
- TSError("[%s] Failed to process process", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Failed to process process", __FUNCTION__);
} else {
TSDebug(DEBUG_TAG, "[%s] Processed request successfully", __FUNCTION__);
}
@@ -353,7 +353,7 @@ hook_beacon_intercept(TSHttpTxn txnp)
{
TSCont contp = TSContCreate(txn_intercept, TSMutexCreate());
if (!contp) {
- TSError("[%s] Could not create intercept request", __FUNCTION__);
+ TSError("[ats_beacon_intercept][%s] Could not create intercept request", __FUNCTION__);
return false;
}
InterceptCtx *cont_data = new InterceptCtx(contp);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_config.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_config.cc b/plugins/experimental/ats_pagespeed/ats_config.cc
index cfd88f0..250b455 100644
--- a/plugins/experimental/ats_pagespeed/ats_config.cc
+++ b/plugins/experimental/ats_pagespeed/ats_config.cc
@@ -1,3 +1,4 @@
+
/** @file
A brief file description
@@ -153,7 +154,7 @@ AtsConfig::Parse(const char *path)
AtsHostConfig *current_host_configuration = host_configurations_[0];
if (pathstring.empty()) {
- TSError("Empty path passed in AtsConfig::Parse");
+ TSError("[ats_config] Empty path passed in AtsConfig::Parse");
return false;
}
@@ -165,7 +166,7 @@ AtsConfig::Parse(const char *path)
f.open(path, std::ios::in);
if (!f.is_open()) {
- TSError("could not open file [%s], skip", path);
+ TSError("[ats_config] Could not open file [%s], skip", path);
return false;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_header_utils.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_header_utils.cc b/plugins/experimental/ats_pagespeed/ats_header_utils.cc
index 0b43a8a..d022809 100644
--- a/plugins/experimental/ats_pagespeed/ats_header_utils.cc
+++ b/plugins/experimental/ats_pagespeed/ats_header_utils.cc
@@ -90,7 +90,7 @@ set_header(TSMBuffer bufp, TSMLoc hdr_loc, const char *header_name, const char *
TSMimeHdrFieldAppend(bufp, hdr_loc, field_loc);
TSMimeHdrFieldValueStringSet(bufp, hdr_loc, field_loc, -1, header_value, -1);
} else {
- TSError("field creation error for field [%s]", header_name);
+ TSError("[ats_header_utils] Field creation error for field [%s]", header_name);
return;
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_pagespeed.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_pagespeed.cc b/plugins/experimental/ats_pagespeed/ats_pagespeed.cc
index 591126e..5ef7587 100644
--- a/plugins/experimental/ats_pagespeed/ats_pagespeed.cc
+++ b/plugins/experimental/ats_pagespeed/ats_pagespeed.cc
@@ -221,7 +221,7 @@ ps_determine_request_options(const RewriteOptions *domain_options, /* may be nul
if (!server_context->GetQueryOptions(request_context, domain_options, url, request_headers, response_headers, &rewrite_query)) {
// Failed to parse query params or request headers. Treat this as if there
// were no query params given.
- TSError("ps_route request: parsing headers or query params failed.");
+ TSError("[ats_pagespeed] ps_route request: parsing headers or query params failed.");
return NULL;
}
@@ -471,11 +471,11 @@ ats_transform_init(TSCont contp, TransformCtx *ctx)
// TODO: check cleanup flow
if (TSHttpTxnTransformRespGet(ctx->txn, &bufp, &hdr_loc) != TS_SUCCESS) {
- TSError("Error TSHttpTxnTransformRespGet");
+ TSError("[ats_pagespeed] TSHttpTxnTransformRespGet failed");
return;
}
if (TSHttpTxnClientReqGet(ctx->txn, &reqp, &req_hdr_loc) != TS_SUCCESS) {
- TSError("Error TSHttpTxnClientReqGet");
+ TSError("[ats_pagespeed] TSHttpTxnClientReqGet failed");
return;
}
@@ -590,13 +590,13 @@ ats_transform_one(TransformCtx *ctx, TSIOBufferReader upstream_reader, int amoun
while (amount > 0) {
downstream_blkp = TSIOBufferReaderStart(upstream_reader);
if (!downstream_blkp) {
- TSError("couldn't get from IOBufferBlock");
+ TSError("[ats_pagespeed] Couldn't get from IOBufferBlock");
return;
}
upstream_buffer = TSIOBufferBlockReadStart(downstream_blkp, upstream_reader, &upstream_length);
if (!upstream_buffer) {
- TSError("couldn't get from TSIOBufferBlockReadStart");
+ TSError("[ats_pagespeed] Couldn't get from TSIOBufferBlockReadStart");
return;
}
@@ -620,7 +620,7 @@ ats_transform_one(TransformCtx *ctx, TSIOBufferReader upstream_reader, int amoun
while (ctx->inflater->HasUnconsumedInput()) {
int num_inflated_bytes = ctx->inflater->InflateBytes(buf, net_instaweb::kStackBufferSize);
if (num_inflated_bytes < 0) {
- TSError("Corrupted inflation");
+ TSError("[ats_pagespeed] Corrupted inflation");
} else if (num_inflated_bytes > 0) {
if (ctx->recorder != NULL) {
ctx->recorder->Write(StringPiece(buf, num_inflated_bytes), ats_process_context->message_handler());
@@ -1164,7 +1164,7 @@ RegisterPlugin()
info.support_email = (char *)"dev@trafficserver.apache.org";
if (TSPluginRegister(&info) != TS_SUCCESS) {
- TSError("Failed to register ATSSpeed");
+ TSError("[ats_pagespeed] Failed to register");
return false;
}
@@ -1201,7 +1201,7 @@ process_configuration()
s.append(ent->d_name);
fprintf(stderr, "parse [%s]\n", s.c_str());
if (!new_config->Parse(s.c_str())) {
- TSError("Error parsing %s", s.c_str());
+ TSError("[ats_pagespeed] Error parsing %s", s.c_str());
}
}
closedir(dir);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/28b243b0/plugins/experimental/ats_pagespeed/ats_resource_intercept.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/ats_pagespeed/ats_resource_intercept.cc b/plugins/experimental/ats_pagespeed/ats_resource_intercept.cc
index 15b66e3..22df176 100644
--- a/plugins/experimental/ats_pagespeed/ats_resource_intercept.cc
+++ b/plugins/experimental/ats_pagespeed/ats_resource_intercept.cc
@@ -177,7 +177,7 @@ resource_intercept(TSCont cont, TSEvent event, void *edata)
if (numBytesWritten == numBytesToWrite) {
TSVConnWrite(intercept_ctx->vconn, cont, intercept_ctx->resp_reader, numBytesToWrite);
} else {
- TSError("Not all output could be written in one go");
+ TSError("[ats_resource_intercept] Not all output could be written in one go");
DCHECK(false);
}
}
@@ -194,18 +194,18 @@ resource_intercept(TSCont cont, TSEvent event, void *edata)
shutDown = true;
break;
case TS_EVENT_ERROR:
- TSError("vconn event: error %s", intercept_ctx->request_ctx->url_string->c_str());
+ TSError("[ats_resource_intercept] vconn event: error %s", intercept_ctx->request_ctx->url_string->c_str());
shutDown = true;
break;
case TS_EVENT_NET_ACCEPT_FAILED:
- TSError("vconn event: accept failed");
+ TSError("[ats_resource_intercept] vconn event: accept failed");
shutDown = true;
break;
case TS_EVENT_IMMEDIATE:
case TS_EVENT_TIMEOUT:
break;
default:
- TSError("default clause event: %d", event);
+ TSError("[ats_resource_intercept] Default clause event: %d", event);
break;
}
@@ -287,7 +287,7 @@ read_cache_header_callback(TSCont cont, TSEvent event, void *edata)
TSMBuffer reqp;
TSMLoc req_hdr_loc;
if (TSHttpTxnClientReqGet(ctx->txn, &reqp, &req_hdr_loc) != TS_SUCCESS) {
- TSError("Error TSHttpTxnClientReqGet for resource!");
+ TSError("[ats_resource_intercept] Error TSHttpTxnClientReqGet for resource!");
TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
return 0;
}