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:12 UTC
[2/3] trafficserver git commit: TS-2106 Added plugin names to all
TSError messages. Removed extraneous newlines. This closes #220.
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;
}