You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2010/05/12 20:33:41 UTC
svn commit: r943621 [2/5] - in /trafficserver/traffic/trunk: iocore/cache/
iocore/cluster/ iocore/dns/ iocore/eventsystem/ iocore/hostdb/ iocore/net/
libinktomi++/ librecords/ proxy/ proxy/congest/ proxy/hdrs/ proxy/http2/
proxy/http2/remap/ proxy/logg...
Modified: trafficserver/traffic/trunk/proxy/logging/LogConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogConfig.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogConfig.cc Wed May 12 18:33:38 2010
@@ -1129,7 +1129,7 @@ size_t
// add a filter that accepts the specified hostname
//
char filter_name[LOG_MAX_FORMAT_LINE + 12];
- ink_snprintf(filter_name, LOG_MAX_FORMAT_LINE, "__accept_%s__", host[i]);
+ snprintf(filter_name, LOG_MAX_FORMAT_LINE, "__accept_%s__", host[i]);
rp_ah[num_filt] =
NEW(new LogFilterString(filter_name,
shn_field, LogFilter::ACCEPT, LogFilter::CASE_INSENSITIVE_CONTAIN, host[i]));
@@ -1736,7 +1736,7 @@ LogConfig::update_space_used()
break;
}
- ink_snprintf(path, MAXPATHLEN, "%s/%s", logfile_dir, m_dir_entry->d_name);
+ snprintf(path, MAXPATHLEN, "%s/%s", logfile_dir, m_dir_entry->d_name);
sret =::stat(path, &sbuf);
if (sret != -1 && S_ISREG(sbuf.st_mode)) {
@@ -1914,7 +1914,7 @@ LogConfig::read_old_log_config()
return;
}
- ink_snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, config_file);
+ snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, config_file);
Debug("log2-config", "Reading log config file %s", config_path);
@@ -2098,14 +2098,14 @@ LogConfig::read_xml_log_config(int from_
char config_path[PATH_MAX];
if (from_memory) {
- ink_snprintf(config_path, PATH_MAX, "%s", "from_memory");
+ snprintf(config_path, PATH_MAX, "%s", "from_memory");
Debug("log2", "Reading from memory %s", config_path);
} else {
if (xml_config_file == NULL) {
Note("No log config file to read");
return;
}
- ink_snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, xml_config_file);
+ snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, xml_config_file);
}
@@ -2670,7 +2670,7 @@ LogConfig::read_log_hosts_file(size_t *
char line[LOG_MAX_FORMAT_LINE];
char **hosts = NULL;
- ink_snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, hosts_config_file);
+ snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, hosts_config_file);
Debug("log2-config", "Reading log hosts from %s", config_path);
Modified: trafficserver/traffic/trunk/proxy/logging/LogFieldAliasMap.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFieldAliasMap.h?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFieldAliasMap.h (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFieldAliasMap.h Wed May 12 18:33:38 2010
@@ -216,7 +216,7 @@ public:
/*
int retVal;
size_t numChars;
- size_t n = ink_snprintf (buf, bufLen, "%u.%u.%u.%u",
+ size_t n = snprintf (buf, bufLen, "%u.%u.%u.%u",
(ip >> 24) & 0xff,
(ip >> 16) & 0xff,
(ip >> 8) & 0xff,
Modified: trafficserver/traffic/trunk/proxy/logging/LogFile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFile.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFile.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFile.cc Wed May 12 18:33:38 2010
@@ -425,7 +425,7 @@ LogFile::roll(long interval_start, long
//
LogUtils::timestamp_to_str((long) start, start_time_ext, 64);
LogUtils::timestamp_to_str((long) end, end_time_ext, 64);
- ink_snprintf(roll_name, MAXPATHLEN, "%s%s%s.%s-%s%s",
+ snprintf(roll_name, MAXPATHLEN, "%s%s%s.%s-%s%s",
m_name,
LOGFILE_SEPARATOR_STRING,
this_machine()->hostname, start_time_ext, end_time_ext, LOGFILE_ROLLED_EXTENSION);
@@ -440,7 +440,7 @@ LogFile::roll(long interval_start, long
while (LogFile::exists(roll_name)) {
Note("The rolled file %s already exists; adding version "
"tag %d to avoid clobbering the existing file.", roll_name, version);
- ink_snprintf(roll_name, MAXPATHLEN, "%s%s%s.%s-%s.%d%s",
+ snprintf(roll_name, MAXPATHLEN, "%s%s%s.%s-%s.%d%s",
m_name,
LOGFILE_SEPARATOR_STRING,
this_machine()->hostname, start_time_ext, end_time_ext, version, LOGFILE_ROLLED_EXTENSION);
@@ -967,7 +967,7 @@ MetaInfo::_write_to_file()
} else {
int n;
if (_flags & VALID_CREATION_TIME) {
- n = ink_snprintf(_buffer, BUF_SIZE, "creation_time = %lu\n", (unsigned long) _creation_time);
+ n = snprintf(_buffer, BUF_SIZE, "creation_time = %lu\n", (unsigned long) _creation_time);
// TODO modify this runtime check so that it is not an assertion
ink_release_assert(n <= BUF_SIZE);
if (write(fd, _buffer, n) == -1) {
@@ -975,7 +975,7 @@ MetaInfo::_write_to_file()
}
}
if (_flags & VALID_SIGNATURE) {
- n = ink_snprintf(_buffer, BUF_SIZE, "object_signature = %llu\n", _log_object_signature);
+ n = snprintf(_buffer, BUF_SIZE, "object_signature = %llu\n", _log_object_signature);
// TODO modify this runtime check so that it is not an assertion
ink_release_assert(n <= BUF_SIZE);
if (write(fd, _buffer, n) == -1) {
Modified: trafficserver/traffic/trunk/proxy/logging/LogFilter.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFilter.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFilter.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFilter.cc Wed May 12 18:33:38 2010
@@ -206,7 +206,7 @@ LogFilter::filter_from_specification(cha
const size_t buff_size = 256;
char filter_name[buff_size];
- ink_snprintf(filter_name, buff_size, "%s: %s %s %s", *format_name, field_name, OPERATOR_NAME[oper], value);
+ snprintf(filter_name, buff_size, "%s: %s %s %s", *format_name, field_name, OPERATOR_NAME[oper], value);
// Ok, now create the LogFilter. There are two types: int and string
// filters. Look at the field type to determine which is the one to
Modified: trafficserver/traffic/trunk/proxy/logging/LogHost.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogHost.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogHost.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogHost.cc Wed May 12 18:33:38 2010
@@ -321,7 +321,7 @@ LogHost::create_orphan_LogFile_object()
ink_assert(name_buf != NULL);
// NT: replace ':'s with '-'s. This change is necessary because
// NT doesn't like filenames with ':'s in them. ^_^
- ink_snprintf(name_buf, name_len, "%s%s%s-%u.%s",
+ snprintf(name_buf, name_len, "%s%s%s-%u.%s",
m_object_filename, LOGFILE_SEPARATOR_STRING, name(), port(), orphan_ext);
// should check for conflicts with orphan filename
Modified: trafficserver/traffic/trunk/proxy/logging/LogObject.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogObject.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogObject.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogObject.cc Wed May 12 18:33:38 2010
@@ -810,7 +810,7 @@ TextLogObject::va_write(const char *form
return Log::FAIL;
}
- len += ink_vsnprintf(&entry[len], MAX_ENTRY - len, format, ap);
+ len += vsnprintf(&entry[len], MAX_ENTRY - len, format, ap);
//
// Now that we have an entry and it's length (len), we can place it
Modified: trafficserver/traffic/trunk/proxy/logging/LogUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogUtils.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogUtils.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogUtils.cc Wed May 12 18:33:38 2010
@@ -150,7 +150,7 @@ LogUtils::timestamp_to_netscape_str(long
offset = zone / -60;
sign = '+';
}
- int glen = ink_snprintf(gmtstr, 16, "%c%.2d%.2d",
+ int glen = snprintf(gmtstr, 16, "%c%.2d%.2d",
sign, offset / 60, offset % 60);
strftime(timebuf, 64 - glen, "%d/%b/%Y:%H:%M:%S ", tms);
@@ -272,7 +272,7 @@ LogUtils::manager_alarm(LogUtils::AlarmT
snprintf(msg_buf, sizeof(msg_buf), "No Message");
} else {
va_start(ap, msg);
- ink_vsnprintf(msg_buf, LOG_MAX_FORMATTED_LINE, msg, ap);
+ vsnprintf(msg_buf, LOG_MAX_FORMATTED_LINE, msg, ap);
va_end(ap);
}
@@ -511,7 +511,7 @@ LogUtils::timestamp_to_hex_str(unsigned
int
LogUtils::ip_to_str (unsigned ip, char *str, unsigned len)
{
- int ret = ink_snprintf (str, len, "%u.%u.%u.%u",
+ int ret = snprintf (str, len, "%u.%u.%u.%u",
(ip >> 24) & 0xff,
(ip >> 16) & 0xff,
(ip >> 8) & 0xff,
Modified: trafficserver/traffic/trunk/proxy/logstats.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logstats.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logstats.cc (original)
+++ trafficserver/traffic/trunk/proxy/logstats.cc Wed May 12 18:33:38 2010
@@ -1776,7 +1776,7 @@ main(int argc, char *argv[])
// Get TS directory
if (0 == get_ts_directory(ts_path,sizeof(ts_path))) {
ink_strncpy(system_root_dir, ts_path, sizeof(system_root_dir));
- ink_snprintf(system_log_dir, sizeof(system_log_dir), "%s/var/log/trafficserver", system_root_dir);
+ snprintf(system_log_dir, sizeof(system_log_dir), "%s/var/log/trafficserver", system_root_dir);
} else {
ink_strncpy(system_log_dir, DEFAULT_LOG_DIRECTORY, sizeof(system_log_dir));
}
@@ -1875,7 +1875,7 @@ main(int argc, char *argv[])
// Change directory to the log dir
if (chdir(system_log_dir) < 0) {
- ink_snprintf(ymon_notice, sizeof(ymon_notice), "can't chdir to %s", system_log_dir);
+ snprintf(ymon_notice, sizeof(ymon_notice), "can't chdir to %s", system_log_dir);
my_exit(YMON_CRITICAL, ymon_notice);
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/BaseRecords.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/BaseRecords.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/BaseRecords.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/BaseRecords.cc Wed May 12 18:33:38 2010
@@ -88,11 +88,11 @@ BaseRecords::BaseRecords(char *mpath, co
/* Record our pid, for passing to local manager */
pid = getpid();
- ink_snprintf(str_pid, sizeof(str_pid), "%ld", pid);
+ snprintf(str_pid, sizeof(str_pid), "%ld", pid);
for (int j = 0; j < MAX_RECORD_TYPE; j++) {
char name[80];
- ink_snprintf(name, sizeof(name), "mgmt-mutex-%d", j);
+ snprintf(name, sizeof(name), "mgmt-mutex-%d", j);
ink_mutex_init(&mutex[j], name);
updateCount[j] = 0;
}
@@ -500,9 +500,9 @@ BaseRecords::rereadRecordFile(char *path
mgmt_fatal(stderr, "[BaseRecords::rereadRecordFile] Null path or file\n");
}
// Look for a "shadow" records.config file, internal for process(records.config) only
- ink_snprintf(fname, sizeof(fname), "%s%s%s.shadow", path, DIR_SEP, f);
+ snprintf(fname, sizeof(fname), "%s%s%s.shadow", path, DIR_SEP, f);
if (!(fin = mgmt_fopen(fname, "r+"))) {
- ink_snprintf(fname, sizeof(fname), "%s%s%s", path, DIR_SEP, f);
+ snprintf(fname, sizeof(fname), "%s%s%s", path, DIR_SEP, f);
if (!(fin = mgmt_fopen(fname, "r+"))) {
mgmt_fatal(stderr, "[BaseRecords::rereadRecordFile] " "Unable to open file '%s', %s\n", fname, strerror(errno));
}
@@ -1923,7 +1923,7 @@ BaseRecords::getExternalRecordValue(Reco
void *value;
if (p) {
- ink_snprintf(pname, sizeof(pname), "%s-%s", p, rec->name);
+ snprintf(pname, sizeof(pname), "%s-%s", p, rec->name);
name = pname;
} else {
name = rec->name;
@@ -1978,9 +1978,9 @@ BaseRecords::removeExternalRecords(Recor
if (record_db->mgmt_batch_open()) {
for (int i = 0; i < recs->num_recs; i++) {
if (p != -1) {
- ink_snprintf(name, sizeof(name), "%ld-%s", p, recs->recs[i].name);
+ snprintf(name, sizeof(name), "%ld-%s", p, recs->recs[i].name);
} else {
- ink_snprintf(name, sizeof(name), "%ld-%s", pid, recs->recs[i].name);
+ snprintf(name, sizeof(name), "%ld-%s", pid, recs->recs[i].name);
}
record_db->mgmt_remove(name, strlen(name));
}
@@ -2026,15 +2026,15 @@ BaseRecords::printRecord(Record rec)
switch (rec.stype) {
case INK_COUNTER:
fprintf(stderr, "\tType: COUNTER\n");
- ink_fprintf(stderr, "\tValue: '%lld'\n", rec.data.counter_data);
+ fprintf(stderr, "\tValue: '%lld'\n", rec.data.counter_data);
break;
case INK_INT:
fprintf(stderr, "\tType: INT\n");
- ink_fprintf(stderr, "\tValue: '%lld'\n", rec.data.int_data);
+ fprintf(stderr, "\tValue: '%lld'\n", rec.data.int_data);
break;
case INK_LLONG:
fprintf(stderr, "\tType: LLONG\n");
- ink_fprintf(stderr, "\tValue: '%lld'\n", rec.data.llong_data);
+ fprintf(stderr, "\tValue: '%lld'\n", rec.data.llong_data);
break;
case INK_FLOAT:
fprintf(stderr, "\tType: FLOAT\n");
@@ -2170,7 +2170,7 @@ BaseRecords::createRecordsFile(char *fna
if (type == PROCESS)
tmp = 0;
newFile->copyFrom("COUNTER ", strlen("COUNTER "));
- ink_snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
+ snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
newFile->copyFrom(str_val, strlen(str_val));
break;
}
@@ -2179,7 +2179,7 @@ BaseRecords::createRecordsFile(char *fna
if (type == PROCESS)
tmp = 0;
newFile->copyFrom("INT ", strlen("INT "));
- ink_snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
+ snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
newFile->copyFrom(str_val, strlen(str_val));
break;
}
@@ -2188,7 +2188,7 @@ BaseRecords::createRecordsFile(char *fna
if (type == PROCESS)
tmp = 0;
newFile->copyFrom("LLONG ", strlen("LLONG "));
- ink_snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
+ snprintf(str_val, sizeof(str_val), "%lld\n", tmp);
newFile->copyFrom(str_val, strlen(str_val));
break;
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/Main.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/Main.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/Main.cc Wed May 12 18:33:38 2010
@@ -149,7 +149,7 @@ check_lockfile()
//////////////////////////////////////
// test for presence of server lock //
//////////////////////////////////////
- ink_snprintf(lockfile, PATH_MAX, "%s%s%s", system_local_state_dir, DIR_SEP, SERVER_LOCK);
+ snprintf(lockfile, PATH_MAX, "%s%s%s", system_local_state_dir, DIR_SEP, SERVER_LOCK);
Lockfile server_lockfile(lockfile);
err = server_lockfile.Open(&holding_pid);
if (err == 1) {
@@ -174,7 +174,7 @@ check_lockfile()
///////////////////////////////////////////
// try to get the exclusive manager lock //
///////////////////////////////////////////
- ink_snprintf(lockfile, sizeof(lockfile), "%s%s%s", system_local_state_dir, DIR_SEP, MANAGER_LOCK);
+ snprintf(lockfile, sizeof(lockfile), "%s%s%s", system_local_state_dir, DIR_SEP, MANAGER_LOCK);
Lockfile manager_lockfile(lockfile);
err = manager_lockfile.Get(&holding_pid);
if (err != 1) {
@@ -627,7 +627,7 @@ main(int argc, char **argv)
j = 0;
while (i < argc) {
- ink_snprintf(&tsArgs[j], ((size_of_args + 1) - j), " %s", argv[i]);
+ snprintf(&tsArgs[j], ((size_of_args + 1) - j), " %s", argv[i]);
j += strlen(argv[i]) + 1;
++i;
}
@@ -696,7 +696,7 @@ main(int argc, char **argv)
check_lockfile();
- ink_snprintf(config_internal_dir, sizeof(config_internal_dir),
+ snprintf(config_internal_dir, sizeof(config_internal_dir),
"%s%sinternal", mgmt_path, DIR_SEP);
url_init(config_internal_dir);
mime_init(config_internal_dir);
@@ -913,7 +913,7 @@ main(int argc, char **argv)
char absolute_vipconf_binary[1024];
struct stat buf;
- ink_snprintf(absolute_vipconf_binary, sizeof(absolute_vipconf_binary), "%s/vip_config", lmgmt->bin_path);
+ snprintf(absolute_vipconf_binary, sizeof(absolute_vipconf_binary), "%s/vip_config", lmgmt->bin_path);
if (stat(absolute_vipconf_binary, &buf) < 0) {
mgmt_elog(stderr, "[main] Unable to stat vip_config for proper permissions\n");
} else if (!((buf.st_mode & S_ISUID) &&
@@ -942,7 +942,7 @@ main(int argc, char **argv)
//For OEM releases we check here whether a floppy with the correct config file exists
//if it does, we first configure the network, then we continue
char floppyLockFile[256];
- ink_snprintf(floppyLockFile, sizeof(floppyLockFile), "./etc/trafficserver/internal/floppy.dat");
+ snprintf(floppyLockFile, sizeof(floppyLockFile), "./etc/trafficserver/internal/floppy.dat");
struct stat lockFileStat;
FILE *floppy_lock_fd;
bool floppyRestore = true;
@@ -1525,9 +1525,9 @@ extractConfigInfo(char *mgmt_path, const
/* Figure out what user we should run as */
if (mgmt_path && recs_conf) {
FILE *fin;
- ink_snprintf(file, sizeof(file), "%s%s%s.shadow", mgmt_path, DIR_SEP, recs_conf);
+ snprintf(file, sizeof(file), "%s%s%s.shadow", mgmt_path, DIR_SEP, recs_conf);
if (!(fin = fopen(file, "r"))) {
- ink_snprintf(file, sizeof(file), "%s%s%s", mgmt_path, DIR_SEP, recs_conf);
+ snprintf(file, sizeof(file), "%s%s%s", mgmt_path, DIR_SEP, recs_conf);
if (!(fin = fopen(file, "r"))) {
mgmt_elog(stderr, "[extractConfigInfo] Unable to open config file(%s)\n", file);
_exit(1);
Modified: trafficserver/traffic/trunk/proxy/mgmt2/MultiFile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/MultiFile.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/MultiFile.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/MultiFile.cc Wed May 12 18:33:38 2010
@@ -256,6 +256,6 @@ MultiFile::newPathString(const char *s1,
newLen = strlen(s1) + strlen(s2) + 2;
newStr = new char[newLen];
ink_assert(newStr != NULL);
- ink_snprintf(newStr, newLen, "%s%s%s", s1, DIR_SEP, s2);
+ snprintf(newStr, newLen, "%s%s%s", s1, DIR_SEP, s2);
return newStr;
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/ProcessManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/ProcessManager.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/ProcessManager.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/ProcessManager.cc Wed May 12 18:33:38 2010
@@ -441,7 +441,7 @@ ProcessManager::addPluginCounter(const c
{
if (record_data->addPluginCounter(name, value) == true) {
char msg[512];
- ink_sprintf(msg, "%s %d %lld", name, INK_COUNTER, value);
+ sprintf(msg, "%s %d %lld", name, INK_COUNTER, value);
signalManager(MGMT_SIGNAL_PLUGIN_ADD_REC, msg);
return true;
}
@@ -454,7 +454,7 @@ ProcessManager::addPluginInteger(const c
{
if (record_data->addPluginInteger(name, value) == true) {
char msg[512];
- ink_sprintf(msg, "%s %d %lld", name, INK_INT, value);
+ sprintf(msg, "%s %d %lld", name, INK_INT, value);
pmgmt->signalManager(MGMT_SIGNAL_PLUGIN_ADD_REC, msg);
return true;
}
@@ -467,7 +467,7 @@ ProcessManager::addPluginFloat(const cha
{
if (record_data->addPluginFloat(name, value) == true) {
char msg[512];
- ink_sprintf(msg, "%s %d %.5f", name, INK_FLOAT, value);
+ sprintf(msg, "%s %d %.5f", name, INK_FLOAT, value);
pmgmt->signalManager(MGMT_SIGNAL_PLUGIN_ADD_REC, msg);
return true;
}
@@ -480,7 +480,7 @@ ProcessManager::addPluginString(const ch
{
if (record_data->addPluginString(name, value) == true) {
char msg[512];
- ink_sprintf(msg, "%s %d %s", name, INK_STRING, value);
+ sprintf(msg, "%s %d %s", name, INK_STRING, value);
pmgmt->signalManager(MGMT_SIGNAL_PLUGIN_ADD_REC, msg);
return true;
}
@@ -610,15 +610,15 @@ checkBackDoorP(int req_fd, char *message
Records *the_records = (Records *) hash_value;
switch (the_records->recs[id].stype) {
case INK_COUNTER:
- ink_sprintf(reply, "\nRecord '%s' Val: '%lld'\n", the_records->recs[id].name,
+ sprintf(reply, "\nRecord '%s' Val: '%lld'\n", the_records->recs[id].name,
the_records->recs[id].data.counter_data);
break;
case INK_INT:
- ink_sprintf(reply, "\nRecord: '%s' Val: '%lld'\n", the_records->recs[id].name,
+ sprintf(reply, "\nRecord: '%s' Val: '%lld'\n", the_records->recs[id].name,
the_records->recs[id].data.int_data);
break;
case INK_LLONG:
- ink_sprintf(reply, "\nRecord: '%s' Val: '%lld'\n", the_records->recs[id].name,
+ sprintf(reply, "\nRecord: '%s' Val: '%lld'\n", the_records->recs[id].name,
the_records->recs[id].data.llong_data);
break;
case INK_FLOAT:
Modified: trafficserver/traffic/trunk/proxy/mgmt2/Rollback.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/Rollback.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/Rollback.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/Rollback.cc Wed May 12 18:33:38 2010
@@ -106,7 +106,7 @@ root_access_needed(root_access_needed_)
}
int configDirLen = strlen(configTmp) + 4;
configDir = new char[configDirLen];
- ink_snprintf(configDir, configDirLen, "%s%s", configTmp, DIR_SEP);
+ snprintf(configDir, configDirLen, "%s%s", configTmp, DIR_SEP);
ink_mutex_init(&fileAccessLock, "RollBack Mutex");
@@ -161,7 +161,7 @@ root_access_needed(root_access_needed_)
#endif
if (fd >= 0) {
alarmMsg = (char *) xmalloc(2048);
- ink_snprintf(alarmMsg, 2048, "Created zero length place holder for config file %s", fileName);
+ snprintf(alarmMsg, 2048, "Created zero length place holder for config file %s", fileName);
mgmt_log(stderr, "[RollBack::Rollback] %s\n", alarmMsg);
lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
xfree(alarmMsg);
@@ -227,13 +227,13 @@ root_access_needed(root_access_needed_)
if (testFD < 0) {
// We are unable to either read or write the file
- ink_snprintf(alarmMsg, 2048, "Unable to read or write config file");
+ snprintf(alarmMsg, 2048, "Unable to read or write config file");
mgmt_log(stderr, "[Rollback::Rollback] %s %s: %s\n", alarmMsg, fileName, strerror(errno));
lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
} else {
// Read is OK and write fails
- ink_snprintf(alarmMsg, 2048, "Config file is read-only");
+ snprintf(alarmMsg, 2048, "Config file is read-only");
mgmt_log(stderr, "[Rollback::Rollback] %s : %s\n", alarmMsg, fileName);
lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
closeFile(testFD);
@@ -801,7 +801,7 @@ Rollback::findVersions_ml(ExpandingArray
// Append '*' as a wildcard for FindFirstFile()
size_t configDirLen = strlen(configDir) + 2;
searchPattern = new char[configDirLen];
- ink_snprintf(searchPattern, configDirLen, "%s*", configDir);
+ snprintf(searchPattern, configDirLen, "%s*", configDir);
HANDLE hDInfo = FindFirstFile(searchPattern, &W32FD);
if (INVALID_HANDLE_VALUE == hDInfo) {
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/CfgContextImpl.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/CfgContextImpl.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/CfgContextImpl.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/CfgContextImpl.cc Wed May 12 18:33:38 2010
@@ -524,7 +524,7 @@ CongestionObj::formatEleToRule()
if (pos < sizeof(buf)) {
switch (m_ele->pd_type) {
case INK_PD_DOMAIN:
- psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "dest_domain=%s ", m_ele->pd_val);
+ psize = snprintf(buf + pos, sizeof(buf) - pos, "dest_domain=%s ", m_ele->pd_val);
break;
case INK_PD_HOST:
psize = snprintf(buf + pos, sizeof(buf) - pos, "dest_host=%s ", m_ele->pd_val);
@@ -546,58 +546,58 @@ CongestionObj::formatEleToRule()
}
// secondary specifiers
if (m_ele->prefix) {
- if (pos < sizeof(buf) && (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "prefix=%s ", m_ele->prefix)) > 0)
+ if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "prefix=%s ", m_ele->prefix)) > 0)
pos += psize;
}
if (m_ele->port > 0) {
- if (pos < sizeof(buf) && (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "port=%d ", m_ele->port)) > 0)
+ if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "port=%d ", m_ele->port)) > 0)
pos += psize;
}
if (pos < sizeof(buf) &&
(psize =
- ink_snprintf(buf + pos, sizeof(buf) - pos, "max_connection_failures=%d ", m_ele->max_connection_failures)) > 0)
+ snprintf(buf + pos, sizeof(buf) - pos, "max_connection_failures=%d ", m_ele->max_connection_failures)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "fail_window=%d ", m_ele->fail_window)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "fail_window=%d ", m_ele->fail_window)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "proxy_retry_interval=%d ", m_ele->proxy_retry_interval)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "proxy_retry_interval=%d ", m_ele->proxy_retry_interval)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "client_wait_interval=%d ", m_ele->client_wait_interval)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "client_wait_interval=%d ", m_ele->client_wait_interval)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "wait_interval_alpha=%d ", m_ele->wait_interval_alpha)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "wait_interval_alpha=%d ", m_ele->wait_interval_alpha)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_timeout=%d ", m_ele->live_os_conn_timeout)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_timeout=%d ", m_ele->live_os_conn_timeout)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_retries=%d ", m_ele->live_os_conn_retries)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_retries=%d ", m_ele->live_os_conn_retries)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_timeout=%d ", m_ele->dead_os_conn_timeout)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_timeout=%d ", m_ele->dead_os_conn_timeout)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_retries=%d ", m_ele->dead_os_conn_retries)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_retries=%d ", m_ele->dead_os_conn_retries)) > 0)
pos += psize;
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "max_connection=%d ", m_ele->max_connection)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "max_connection=%d ", m_ele->max_connection)) > 0)
pos += psize;
if (m_ele->error_page_uri) {
if (pos < sizeof(buf) &&
- (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "error_page=%s ", m_ele->error_page_uri)) > 0)
+ (psize = snprintf(buf + pos, sizeof(buf) - pos, "error_page=%s ", m_ele->error_page_uri)) > 0)
pos += psize;
}
switch (m_ele->scheme) {
case INK_HTTP_CONGEST_PER_IP:
- if (pos<sizeof(buf) && (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_ip "))> 0)
+ if (pos<sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_ip "))> 0)
pos += psize;
break;
case INK_HTTP_CONGEST_PER_HOST:
- if (pos<sizeof(buf) && (psize = ink_snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_host "))> 0)
+ if (pos<sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_host "))> 0)
pos += psize;
break;
default:
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPI.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPI.cc Wed May 12 18:33:38 2010
@@ -203,7 +203,7 @@ ProxyStateSet(INKProxyStateT state, INKC
if (!found)
goto Lerror;
- ink_snprintf(tsArgs, MAX_BUF_SIZE, "%s", proxy_options);
+ snprintf(tsArgs, MAX_BUF_SIZE, "%s", proxy_options);
xfree(proxy_options);
break;
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPIShared.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPIShared.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPIShared.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/CoreAPIShared.cc Wed May 12 18:33:38 2010
@@ -165,7 +165,7 @@ sendHTTPRequest(int sock, char *req, ink
size_t length = 0;
memset(request, 0, BUFSIZ);
- ink_snprintf(request, BUFSIZ, "GET %s HTTP/1.0\r\n\r\n", req);
+ snprintf(request, BUFSIZ, "GET %s HTTP/1.0\r\n\r\n", req);
length = strlen(request);
#ifdef _WIN32
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/INKMgmtAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/INKMgmtAPI.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/INKMgmtAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/INKMgmtAPI.cc Wed May 12 18:33:38 2010
@@ -2326,7 +2326,7 @@ INKReadFromUrlEx(const char *url, char *
}
/* sending the HTTP request via the established socket */
- ink_snprintf(request, BUFSIZE, "http://%s:%d/%s", httpHost, httpPort, httpPath);
+ snprintf(request, BUFSIZE, "http://%s:%d/%s", httpHost, httpPort, httpPath);
if ((status = sendHTTPRequest(hFD, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
@@ -2373,7 +2373,7 @@ INKLookupFromCacheUrl(INKString url, INK
err = INK_ERR_FAIL;
goto END;
}
- ink_snprintf(request, BUFSIZE, "http://{cache}/lookup_url?url=%s", url);
+ snprintf(request, BUFSIZE, "http://{cache}/lookup_url?url=%s", url);
if ((err = sendHTTPRequest(fd, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
@@ -2411,7 +2411,7 @@ INKLookupFromCacheUrlRegex(INKString url
err = INK_ERR_FAIL;
goto END;
}
- ink_snprintf(request, BUFSIZE, "http://{cache}/lookup_regex?url=%s", url_regex);
+ snprintf(request, BUFSIZE, "http://{cache}/lookup_regex?url=%s", url_regex);
if ((err = sendHTTPRequest(fd, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
@@ -2448,7 +2448,7 @@ INKDeleteFromCacheUrl(INKString url, INK
err = INK_ERR_FAIL;
goto END;
}
- ink_snprintf(request, BUFSIZE, "http://{cache}/delete_url?url=%s", url);
+ snprintf(request, BUFSIZE, "http://{cache}/delete_url?url=%s", url);
if ((err = sendHTTPRequest(fd, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
@@ -2486,7 +2486,7 @@ INKDeleteFromCacheUrlRegex(INKString url
err = INK_ERR_FAIL;
goto END;
}
- ink_snprintf(request, BUFSIZE, "http://{cache}/delete_regex?url=%s", url_regex);
+ snprintf(request, BUFSIZE, "http://{cache}/delete_regex?url=%s", url_regex);
if ((err = sendHTTPRequest(fd, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
@@ -2523,7 +2523,7 @@ INKInvalidateFromCacheUrlRegex(INKString
err = INK_ERR_FAIL;
goto END;
}
- ink_snprintf(request, BUFSIZE, "http://{cache}/invalidate_regex?url=%s", url_regex);
+ snprintf(request, BUFSIZE, "http://{cache}/invalidate_regex?url=%s", url_regex);
if ((err = sendHTTPRequest(fd, request, (inku64) timeout)) != INK_ERR_OKAY)
goto END;
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/TSControlMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/TSControlMain.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/TSControlMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/TSControlMain.cc Wed May 12 18:33:38 2010
@@ -817,7 +817,7 @@ handle_event_get_mlt(struct SocketInfo s
while (!queue_is_empty(event_list)) {
event_name = (char *) dequeue(event_list);
if (event_name) {
- ink_snprintf(buf + buf_pos, (MAX_BUF_SIZE - buf_pos), "%s%c", event_name, REMOTE_DELIM);
+ snprintf(buf + buf_pos, (MAX_BUF_SIZE - buf_pos), "%s%c", event_name, REMOTE_DELIM);
buf_pos += (strlen(event_name) + 1);
xfree(event_name); //free the llq entry
}
@@ -931,7 +931,7 @@ handle_snapshot_get_mlt(struct SocketInf
while (!queue_is_empty(snap_list)) {
snap_name = (char *) dequeue(snap_list);
if (snap_name) {
- ink_snprintf(buf + buf_pos, (MAX_BUF_SIZE - buf_pos), "%s%c", snap_name, REMOTE_DELIM);
+ snprintf(buf + buf_pos, (MAX_BUF_SIZE - buf_pos), "%s%c", snap_name, REMOTE_DELIM);
buf_pos += (strlen(snap_name) + 1);
xfree(snap_name); //free the llq entry
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/api2/remote/CoreAPIRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/api2/remote/CoreAPIRemote.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/api2/remote/CoreAPIRemote.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/api2/remote/CoreAPIRemote.cc Wed May 12 18:33:38 2010
@@ -38,7 +38,6 @@
#include "ink_config.h"
#include <strings.h>
-#include "ink_snprintf.h"
#include "ink_string.h"
#include "ParseRules.h"
#include "CoreAPI.h"
@@ -372,7 +371,7 @@ Diags(INKDiagsT mode, const char *fmt, v
// format the diag message now so it can be sent
// vsnprintf does not compile on DEC
- ink_vsnprintf(diag_msg, MAX_BUF_SIZE - 1, fmt, ap);
+ vsnprintf(diag_msg, MAX_BUF_SIZE - 1, fmt, ap);
INKError ret = send_diags_msg(main_socket_fd, mode, diag_msg);
if (ret != INK_ERR_OKAY) {
//fprintf(stderr, "[Diags] error sending diags message\n");
@@ -467,8 +466,8 @@ HardRestart()
bzero(start_path, 1024);
bzero(stop_path, 1024);
char *root_copy = xstrdup(root_dir);
- ink_snprintf(start_path, sizeof(start_path), "%s/bin/start_traffic_server", root_copy);
- ink_snprintf(stop_path, sizeof(stop_path), "%s/bin/stop_traffic_server", root_copy);
+ snprintf(start_path, sizeof(start_path), "%s/bin/start_traffic_server", root_copy);
+ snprintf(stop_path, sizeof(stop_path), "%s/bin/stop_traffic_server", root_copy);
xfree(root_copy);
INKDiags(INK_DIAG_NOTE, "[HardRestart] start_path = %s", start_path);
@@ -558,7 +557,7 @@ MgmtRecordSetInt(const char *rec_name, M
return INK_ERR_PARAMS;
bzero(str_val, MAX_RECORD_SIZE);
- ink_snprintf(str_val, sizeof(str_val), "%lld", int_val);
+ snprintf(str_val, sizeof(str_val), "%lld", int_val);
ret = mgmt_record_set(rec_name, str_val, action_need);
return ret;
@@ -575,7 +574,7 @@ MgmtRecordSetCounter(const char *rec_nam
return INK_ERR_PARAMS;
bzero(str_val, MAX_RECORD_SIZE);
- ink_snprintf(str_val, sizeof(str_val), "%lld", counter_val);
+ snprintf(str_val, sizeof(str_val), "%lld", counter_val);
ret = mgmt_record_set(rec_name, str_val, action_need);
return ret;
@@ -589,7 +588,7 @@ MgmtRecordSetFloat(const char *rec_name,
INKError ret;
bzero(str_val, MAX_RECORD_SIZE);
- if (ink_snprintf(str_val, sizeof(str_val), "%f", float_val) < 0)
+ if (snprintf(str_val, sizeof(str_val), "%f", float_val) < 0)
return INK_ERR_SYS_CALL;
ret = mgmt_record_set(rec_name, str_val, action_need);
Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/CLI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/CLI.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/CLI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/CLI.cc Wed May 12 18:33:38 2010
@@ -1164,7 +1164,7 @@ handleOverseer(int fd, int mode)
RecAccessT access = RECA_NO_ACCESS;
RecGetRecordAccessType(cur, &access);
if (access == RECA_NO_ACCESS) {
- ink_snprintf(reply, sizeof(reply), "%s is unavailable", cur);
+ snprintf(reply, sizeof(reply), "%s is unavailable", cur);
mgmt_writeline(fd, reply, strlen(reply));
cur = ink_strtok_r(NULL, ",", &lasts);
continue;
@@ -1176,44 +1176,44 @@ handleOverseer(int fd, int mode)
case RECD_COUNTER:{
RecCounter val;
RecGetRecordCounter(cur, &val);
- ink_snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
+ snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
break;
}
case RECD_INT:{
RecInt val;
RecGetRecordInt(cur, &val);
- ink_snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
+ snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
break;
}
case RECD_LLONG:{
RecLLong val;
RecGetRecordLLong(cur, &val);
- ink_snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
+ snprintf(reply, sizeof(reply), "%s = \"%lld\"", cur, val);
break;
}
case RECD_FLOAT:{
RecFloat val;
RecGetRecordFloat(cur, &val);
- ink_snprintf(reply, sizeof(reply), "%s = \"%f\"", cur, val);
+ snprintf(reply, sizeof(reply), "%s = \"%f\"", cur, val);
break;
}
case RECD_STRING:{
RecString val;
RecGetRecordString_Xmalloc(cur, &val);
if (val) {
- ink_snprintf(reply, sizeof(reply), "%s = \"%s\"", cur, val);
+ snprintf(reply, sizeof(reply), "%s = \"%s\"", cur, val);
xfree(val);
} else {
- ink_snprintf(reply, sizeof(reply), "%s = \"\"", cur);
+ snprintf(reply, sizeof(reply), "%s = \"\"", cur);
}
break;
}
default:
- ink_snprintf(reply, sizeof(reply), "%s = UNDEFINED", cur);
+ snprintf(reply, sizeof(reply), "%s = UNDEFINED", cur);
break;
}
} else {
- ink_snprintf(reply, sizeof(reply), "%s = UNDEFINED", cur);
+ snprintf(reply, sizeof(reply), "%s = UNDEFINED", cur);
}
mgmt_writeline(fd, reply, strlen(reply));
cur = ink_strtok_r(NULL, ",", &lasts);
@@ -1271,7 +1271,7 @@ handleOverseer(int fd, int mode)
err = (rec_err != REC_ERR_OKAY);
if (err) {
- ink_snprintf(reply, sizeof(reply), "%s = UNDEFINED", var);
+ snprintf(reply, sizeof(reply), "%s = UNDEFINED", var);
mgmt_writeline(fd, reply, strlen(reply));
mgmt_writeline(fd, ok, strlen(ok));
continue;
Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/CliMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/CliMain.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/CliMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/CliMain.cc Wed May 12 18:33:38 2010
@@ -380,7 +380,7 @@ main(int argc, char **argv)
char ts_path[PATH_NAME_MAX + 1];
char sock_path[PATH_NAME_MAX + 1];
if (0 == cli->GetTSDirectory(ts_path, sizeof(ts_path))) {
- ink_snprintf(sock_path, sizeof(sock_path), "%s/var/trafficserver/cli", ts_path);
+ snprintf(sock_path, sizeof(sock_path), "%s/var/trafficserver/cli", ts_path);
} else {
ink_strncpy(sock_path, clientCLI::defaultSockPath, sizeof(sock_path));
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/clientCLI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/clientCLI.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/clientCLI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/clientCLI.cc Wed May 12 18:33:38 2010
@@ -396,7 +396,7 @@ clientCLI::CliResult clientCLI::getVaria
char
requestStr[512];
- ink_snprintf(requestStr, sizeof(requestStr), "b get %s", name);
+ snprintf(requestStr, sizeof(requestStr), "b get %s", name);
sendCommand(requestStr, &response);
//responseStr = response.bufPtr();
Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc Wed May 12 18:33:38 2010
@@ -3461,7 +3461,7 @@ ConfigTimezone(int index, int setvar)
if (system("/bin/mv /tmp/clock.tmp /etc/sysconfig/clock") == -1)
return CLI_ERROR;
- ink_snprintf(command, sizeof(command), "/bin/cp -f /usr/share/zoneinfo/%s /etc/localtime", new_zone);
+ snprintf(command, sizeof(command), "/bin/cp -f /usr/share/zoneinfo/%s /etc/localtime", new_zone);
if (system(command) == -1)
return CLI_ERROR;
@@ -5806,7 +5806,7 @@ ConfigRadiusKeys(const char *record)
time_t my_time_t;
time(&my_time_t);
memset(file_path, 0, 1024);
- ink_snprintf(file_path, 1024, "%s%spwd_%ld.enc", dir_path, DIR_SEP, my_time_t);
+ snprintf(file_path, 1024, "%s%spwd_%ld.enc", dir_path, DIR_SEP, my_time_t);
if (dir_path)
xfree(dir_path);
Modified: trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc Wed May 12 18:33:38 2010
@@ -687,7 +687,7 @@ ClusterCom::generateClusterDelta(void)
if (highest_delta != LastHighestDelta) {
LastHighestDelta = highest_delta;
char highest_delta_str[32];
- ink_snprintf(highest_delta_str, 31, "%ld", highest_delta);
+ snprintf(highest_delta_str, 31, "%ld", highest_delta);
lmgmt->signalEvent(MGMT_EVENT_HTTP_CLUSTER_DELTA, highest_delta_str);
}
@@ -1485,12 +1485,12 @@ ClusterCom::constructSharedGenericPacket
switch (rec->data_type) {
case RECD_COUNTER:
- ink_sprintf(tmp, "%d:%d: %lld\n", j, rec->data_type, rec->data.rec_counter);
+ sprintf(tmp, "%d:%d: %lld\n", j, rec->data_type, rec->data.rec_counter);
ink_strncpy(&message[running_sum], tmp, (max - running_sum));
running_sum += strlen(tmp);
break;
case RECD_INT:
- ink_sprintf(tmp, "%d:%d: %lld\n", j, rec->data_type, rec->data.rec_int);
+ sprintf(tmp, "%d:%d: %lld\n", j, rec->data_type, rec->data.rec_int);
ink_strncpy(&message[running_sum], tmp, (max - running_sum));
running_sum += strlen(tmp);
break;
@@ -2413,7 +2413,7 @@ checkBackDoor(int req_fd, char *message)
{
ink64 val = (stype == RECD_COUNTER ? REC_readCounter(variable, &found) : REC_readInteger(variable, &found));
if (found) {
- rep_len = ink_snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%lld'\n", variable, val);
+ rep_len = snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%lld'\n", variable, val);
}
break;
}
@@ -2421,7 +2421,7 @@ checkBackDoor(int req_fd, char *message)
{
RecFloat val = REC_readFloat(variable, &found);
if (found) {
- rep_len = ink_snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%f'\n", variable, val);
+ rep_len = snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%f'\n", variable, val);
}
break;
}
@@ -2429,7 +2429,7 @@ checkBackDoor(int req_fd, char *message)
{
char *val = REC_readString(variable, &found);
if (found) {
- rep_len = ink_snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%s'\n", variable, val);
+ rep_len = snprintf(reply, sizeof(reply), "\nRecord '%s' Val: '%s'\n", variable, val);
xfree(val);
}
break;
Modified: trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc Wed May 12 18:33:38 2010
@@ -33,7 +33,6 @@
#include "ink_platform.h"
#include "ink_string.h"
#include "ink_file.h"
-#include "ink_snprintf.h"
#include "Tokenizer.h"
#include "URL.h"
#include "MIME.h"
@@ -186,7 +185,7 @@ parseRemapFile(int fd)
FAIL:
errBuf = (char *) xmalloc(1024);
- ink_snprintf(errBuf, 1024, "[Entry %d] %s", entry, err);
+ snprintf(errBuf, 1024, "[Entry %d] %s", entry, err);
return errBuf;
}
Modified: trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc Wed May 12 18:33:38 2010
@@ -2227,7 +2227,7 @@ writeXmlElement_int(textBuffer * xml, co
{
char tempStr[128];
memset(tempStr, 0, 128);
- ink_snprintf(tempStr, 128, "%d", value);
+ snprintf(tempStr, 128, "%d", value);
writeXmlStartTag(xml, elemName, nsp);
xml->copyFrom(tempStr, strlen(tempStr));
@@ -2257,7 +2257,7 @@ writeXmlAttribute_int(textBuffer * xml,
{
char tempStr[128];
memset(tempStr, 0, 128);
- ink_snprintf(tempStr, 128, "%d", value);
+ snprintf(tempStr, 128, "%d", value);
xml->copyFrom(" ", 1);
xml->copyFrom(attrName, strlen(attrName));
@@ -2291,7 +2291,7 @@ strcmptag(char *fulltag, char *name, cha
if (nsp) {
memset(new_tag, 0, 128);
- ink_snprintf(new_tag, 128, "%s:%s", nsp, name);
+ snprintf(new_tag, 128, "%s:%s", nsp, name);
return strcmp(fulltag, new_tag);
}
@@ -2327,7 +2327,7 @@ convertRecordsFile_ts(char **xml_file)
memset(value, 0, 256);
xml.copyFrom(" ", 2);
varStrFromName(RecordsConfig[r].name, value, 256);
- ink_snprintf(record, 1024, "%s=\"%s\"", RecordsConfig[r].name, value);
+ snprintf(record, 1024, "%s=\"%s\"", RecordsConfig[r].name, value);
xml.copyFrom(record, strlen(record));
xml.copyFrom("\n", 1);
}
@@ -2408,15 +2408,15 @@ getXmlRecType(struct RecordElement rec,
case RC_NULL: // no check type defined, use field type
switch (rec.value_type) {
case INK_STRING:
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:string\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:string\" default=\"%s\"/>", rec.name, rec.value);
break;
case INK_FLOAT:
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:float\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:float\" default=\"%s\"/>", rec.name, rec.value);
break;
case INK_INT:
case INK_COUNTER:
case INK_LLONG:
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:integer\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:integer\" default=\"%s\"/>", rec.name, rec.value);
break;
default:
// Handled here:
@@ -2426,17 +2426,17 @@ getXmlRecType(struct RecordElement rec,
break;
case RC_IP:
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"cnp:ipaddr\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"cnp:ipaddr\" default=\"%s\"/>", rec.name, rec.value);
break;
case RC_INT:
if (rec.regex) {
if (strcmp(rec.regex, "[0-1]") == 0) { // for [0-1] range, make into boolean type
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:boolean\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:boolean\" default=\"%s\"/>", rec.name, rec.value);
} else { // break up [x-y] into ts:range_x_y type
Tokenizer range("[]-");
if (range.Initialize(rec.regex) == 2) {
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"ts:range_%s_%s\" default=\"%s\"/>",
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"ts:range_%s_%s\" default=\"%s\"/>",
rec.name, range[0], range[1], rec.value);
}
}
@@ -2446,21 +2446,21 @@ getXmlRecType(struct RecordElement rec,
case RC_STR:
if (rec.regex) {
if (strcmp(rec.regex, ".*") == 0) {
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:string\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:string\" default=\"%s\"/>", rec.name, rec.value);
} else if (strcmp(rec.regex, "^[0-9]+$") == 0) {
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:integer\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:integer\" default=\"%s\"/>", rec.name, rec.value);
} else if (strcmp(rec.regex, "^[^[:space:]]*") == 0) {
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:pattern_no_space\" default=\"%s\"/>",
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:pattern_no_space\" default=\"%s\"/>",
rec.name, rec.value);
} else if (strcmp(rec.regex, ".+") == 0) {
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:pattern_not_empty\" default=\"%s\"/>",
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"xs:pattern_not_empty\" default=\"%s\"/>",
rec.name, rec.value);
}
}
break;
default: // uses special simpleType in schema
- ink_sprintf(buf, "<xs:attribute name=\"%s\" type=\"FIXME\" default=\"%s\"/>", rec.name, rec.value);
+ sprintf(buf, "<xs:attribute name=\"%s\" type=\"FIXME\" default=\"%s\"/>", rec.name, rec.value);
break;
}
}
@@ -2663,7 +2663,7 @@ testConvertFile_ts(char *file)
char name[128];
memset(name, 0, 128);
- ink_snprintf(name, 128, "%s.xml", file);
+ snprintf(name, 128, "%s.xml", file);
fp = fopen(name, "w");
if (strcmp(file, "all") == 0) {
Modified: trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc Wed May 12 18:33:38 2010
@@ -202,7 +202,7 @@ send_cli_congest_request(const char *arg
}
// send RAF query request
memset(request, 0, 257);
- ink_snprintf(request, 256, "0 congest %s\n", arguments);
+ snprintf(request, 256, "0 congest %s\n", arguments);
raf_writen(s, request, strlen(request));
return s;
Modified: trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc Wed May 12 18:33:38 2010
@@ -567,7 +567,7 @@ commaStrFromInt(RecInt bytes, char *bufV
int numCommas;
char *curPtr;
- ink_sprintf(bufVal, "%lld", bytes);
+ sprintf(bufVal, "%lld", bytes);
len = strlen(bufVal);
// The string is too short to need commas
@@ -605,7 +605,7 @@ commaStrFromLLong(RecLLong bytes, char *
int numCommas;
char *curPtr;
- ink_sprintf(bufVal, "%lld", bytes);
+ sprintf(bufVal, "%lld", bytes);
len = strlen(bufVal);
// The string is too short to need commas
@@ -642,7 +642,7 @@ MbytesFromInt(RecInt bytes, char *bufVal
{
RecInt mBytes = bytes / 1048576;
- ink_sprintf(bufVal, "%lld", mBytes);
+ sprintf(bufVal, "%lld", mBytes);
}
// void MbytesFromLLong(RecLLong bytes, char* bufVal)
@@ -656,7 +656,7 @@ MbytesFromLLong(RecLLong bytes, char *bu
{
RecLLong mBytes = bytes / 1048576;
- ink_sprintf(bufVal, "%lld", mBytes);
+ sprintf(bufVal, "%lld", mBytes);
}
// void bytesFromInt(RecInt bytes, char* bufVal)
@@ -792,7 +792,7 @@ varStrFromName(const char *varNameConst,
} else if (formatOption == 'c') {
commaStrFromInt(data.rec_int, bufVal);
} else {
- ink_sprintf(bufVal, "%lld", data.rec_int);
+ sprintf(bufVal, "%lld", data.rec_int);
}
break;
@@ -805,7 +805,7 @@ varStrFromName(const char *varNameConst,
} else if (formatOption == 'c') {
commaStrFromLLong(data.rec_llong, bufVal);
} else {
- ink_sprintf(bufVal, "%lld", data.rec_llong);
+ sprintf(bufVal, "%lld", data.rec_llong);
}
break;
@@ -818,7 +818,7 @@ varStrFromName(const char *varNameConst,
} else if (formatOption == 'c') {
commaStrFromInt(data.rec_counter, bufVal);
} else {
- ink_sprintf(bufVal, "%lld", data.rec_counter);
+ sprintf(bufVal, "%lld", data.rec_counter);
}
break;
case RECD_FLOAT:
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtRaf.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtRaf.cc?rev=943621&r1=943620&r2=943621&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtRaf.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtRaf.cc Wed May 12 18:33:38 2010
@@ -156,28 +156,28 @@ RafProcessQueryStat(textBuffer * resp, c
} else {
RecGetRecordInt(var, &i);
}
- ink_snprintf(val_output, 256, "%lld", i);
+ snprintf(val_output, 256, "%lld", i);
break;
}
case RECD_LLONG:
{
RecLLong ll = 0;
RecGetRecordLLong(var, &ll);
- ink_snprintf(val_output, 256, "%lld", ll);
+ snprintf(val_output, 256, "%lld", ll);
break;
}
case RECD_FLOAT:
{
RecFloat f = 0;
RecGetRecordFloat(var, &f);
- ink_snprintf(val_output, 256, "%f", f);
+ snprintf(val_output, 256, "%f", f);
break;
}
case RECD_STRING:
{
char *s = NULL;
RecGetRecordString_Xmalloc(var, &s);
- ink_snprintf(val_output, 256, "\"%s\"", s);
+ snprintf(val_output, 256, "\"%s\"", s);
val_output[256] = '\0';
xfree(s);
break;
@@ -192,7 +192,7 @@ RafProcessQueryStat(textBuffer * resp, c
// buffer overflow?
if ((strlen(temp_resp) + strlen(var) + 1 + strlen(val_output)) > (max_resp_len - 1)) {
char msg[257];
- ink_snprintf(msg, 256, "response length exceed %d bytes", max_resp_len);
+ snprintf(msg, 256, "response length exceed %d bytes", max_resp_len);
msg[256] = '\0';
RafOutputHeader(resp, id, "1");
RafOutputArg(resp, msg);
@@ -215,7 +215,7 @@ RafProcessQueryStat(textBuffer * resp, c
RafOutputArg(resp, temp_resp);
} else {
char msg[257];
- ink_snprintf(msg, 256, "%s not found", var);
+ snprintf(msg, 256, "%s not found", var);
msg[256] = '\0';
RafOutputHeader(resp, id, "1");
RafOutputArg(resp, msg);
@@ -241,7 +241,7 @@ RafProcessAlarmCmd(textBuffer * resp, ch
if (alarm != NULL) {
RafOutputHeader(resp, argv[0], "0");
- ink_snprintf(msg, 1024, "%d %s", alarm->type, alarm->desc);
+ snprintf(msg, 1024, "%d %s", alarm->type, alarm->desc);
rafAlarmListLen--;
RafOutputArg(resp, msg);
xfree(alarm);
@@ -325,7 +325,7 @@ RafProcessQueryCmd(textBuffer * resp, ch
RafProcessQueryStat(resp, argv[0], argc, qstring_index, argv);
} else {
char msg[257];
- ink_snprintf(msg, 256, "Node %s not found", argv[qstring_index]);
+ snprintf(msg, 256, "Node %s not found", argv[qstring_index]);
msg[256] = '\0';
RafOutputHeader(resp, argv[0], "1");
RafOutputArg(resp, msg);