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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions iocore/hostdb/HostDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ ParseHostLine(Ptr<RefCountedHostsFileMap> &map, char *l)
}

void
ParseHostFile(const char *path, unsigned int hostdb_hostfile_check_interval)
ParseHostFile(const char *path, unsigned int hostdb_hostfile_check_interval_parse)
{
Ptr<RefCountedHostsFileMap> parsed_hosts_file_ptr;

Expand All @@ -2229,7 +2229,7 @@ ParseHostFile(const char *path, unsigned int hostdb_hostfile_check_interval)
int64_t size = info.st_size + 1;

parsed_hosts_file_ptr = new RefCountedHostsFileMap;
parsed_hosts_file_ptr->next_sync_time = ink_time() + hostdb_hostfile_check_interval;
parsed_hosts_file_ptr->next_sync_time = ink_time() + hostdb_hostfile_check_interval_parse;
parsed_hosts_file_ptr->HostFileText = static_cast<char *>(ats_malloc(size));
if (parsed_hosts_file_ptr->HostFileText) {
char *base = parsed_hosts_file_ptr->HostFileText;
Expand Down
12 changes: 6 additions & 6 deletions iocore/net/SSLUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1734,10 +1734,10 @@ SSLWriteBuffer(SSL *ssl, const void *buf, int64_t nbytes, int64_t &nwritten)
}
int ssl_error = SSL_get_error(ssl, ret);
if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.write")) {
char buf[512];
char tempbuf[512];
unsigned long e = ERR_peek_last_error();
ERR_error_string_n(e, buf, sizeof(buf));
Debug("ssl.error.write", "SSL write returned %d, ssl_error=%d, ERR_get_error=%ld (%s)", ret, ssl_error, e, buf);
ERR_error_string_n(e, tempbuf, sizeof(tempbuf));
Debug("ssl.error.write", "SSL write returned %d, ssl_error=%d, ERR_get_error=%ld (%s)", ret, ssl_error, e, tempbuf);
}
return ssl_error;
}
Expand Down Expand Up @@ -1815,10 +1815,10 @@ SSLReadBuffer(SSL *ssl, void *buf, int64_t nbytes, int64_t &nread)
}
int ssl_error = SSL_get_error(ssl, ret);
if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.read")) {
char buf[512];
char tempbuf[512];
unsigned long e = ERR_peek_last_error();
ERR_error_string_n(e, buf, sizeof(buf));
Debug("ssl.error.read", "SSL read returned %d, ssl_error=%d, ERR_get_error=%ld (%s)", ret, ssl_error, e, buf);
ERR_error_string_n(e, tempbuf, sizeof(tempbuf));
Debug("ssl.error.read", "SSL read returned %d, ssl_error=%d, ERR_get_error=%ld (%s)", ret, ssl_error, e, tempbuf);
}

return ssl_error;
Expand Down
6 changes: 3 additions & 3 deletions iocore/net/UnixNetAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ NetAccept::do_blocking_accept(EThread *t)
#endif
SET_CONTINUATION_HANDLER(vc, (NetVConnHandler)&UnixNetVConnection::acceptEvent);

EThread *t = eventProcessor.assign_thread(opt.etype);
NetHandler *h = get_NetHandler(t);
EThread *localt = eventProcessor.assign_thread(opt.etype);
NetHandler *h = get_NetHandler(localt);
// Assign NetHandler->mutex to NetVC
vc->mutex = h->mutex;
t->schedule_imm(vc);
localt->schedule_imm(vc);
} while (loop);

return 1;
Expand Down
4 changes: 2 additions & 2 deletions plugins/background_fetch/background_fetch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ cont_handle_response(TSCont contp, TSEvent event, void *edata)
TSDebug(PLUGIN_NAME, "Testing: response status code: %d?", status);
if (TS_HTTP_STATUS_PARTIAL_CONTENT == status || (config->allow304() && TS_HTTP_STATUS_NOT_MODIFIED == status)) {
// Everything looks good so far, add a TXN hook for SEND_RESPONSE_HDR
TSCont contp = TSContCreate(cont_check_cacheable, nullptr);
TSCont localcontp = TSContCreate(cont_check_cacheable, nullptr);

TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, localcontp);
}
// Release the response MLoc
TSHandleMLocRelease(response, TS_NULL_MLOC, resp_hdr);
Expand Down
8 changes: 4 additions & 4 deletions plugins/experimental/memcache/tsmemcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -962,13 +962,13 @@ MC::ascii_incr_decr_event(int event, void *data)
}
header.cas = ink_atomic_increment(&next_cas, 1);
{
char *data = nullptr;
int len = 0;
char *localdata = nullptr;
int len = 0;
// must be huge, why convert to a counter ??
if (cwvc->get_single_data((void **)&data, &len) < 0) {
if (cwvc->get_single_data((void **)&localdata, &len) < 0) {
goto Lfail;
}
uint64_t new_value = xatoull(data, data + len);
uint64_t new_value = xatoull(localdata, localdata + len);
if (f.set_incr) {
new_value += delta;
} else {
Expand Down
16 changes: 8 additions & 8 deletions plugins/header_rewrite/conditions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1113,17 +1113,17 @@ ConditionCidr::append_value(std::string &s, const Resources &res)
if (addr) {
switch (addr->sa_family) {
case AF_INET: {
char res[INET_ADDRSTRLEN];
char resource[INET_ADDRSTRLEN];
struct in_addr ipv4 = reinterpret_cast<const struct sockaddr_in *>(addr)->sin_addr;

ipv4.s_addr &= _v4_mask.s_addr;
inet_ntop(AF_INET, &ipv4, res, INET_ADDRSTRLEN);
if (res[0]) {
s += res;
inet_ntop(AF_INET, &ipv4, resource, INET_ADDRSTRLEN);
if (resource[0]) {
s += resource;
}
} break;
case AF_INET6: {
char res[INET6_ADDRSTRLEN];
char resource[INET6_ADDRSTRLEN];
struct in6_addr ipv6 = reinterpret_cast<const struct sockaddr_in6 *>(addr)->sin6_addr;

if (_v6_zero_bytes > 0) {
Expand All @@ -1132,9 +1132,9 @@ ConditionCidr::append_value(std::string &s, const Resources &res)
if (_v6_mask != 0xff) {
ipv6.s6_addr[16 - _v6_zero_bytes] &= _v6_mask;
}
inet_ntop(AF_INET6, &ipv6, res, INET6_ADDRSTRLEN);
if (res[0]) {
s += res;
inet_ntop(AF_INET6, &ipv6, resource, INET6_ADDRSTRLEN);
if (resource[0]) {
s += resource;
}
} break;
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/multiplexer/dispatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ class Handler
if (TSIsDebugTagSet(PLUGIN_TAG) > 0) {
const TSIOBuffer buffer = TSIOBufferCreate();
TSHttpHdrPrint(b, l, buffer);
std::string b;
read(buffer, b);
TSDebug(PLUGIN_TAG, "Response header for \"%s\" was:\n%s", url.c_str(), b.c_str());
std::string buf;
read(buffer, buf);
TSDebug(PLUGIN_TAG, "Response header for \"%s\" was:\n%s", url.c_str(), buf.c_str());
TSIOBufferDestroy(buffer);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/traffic_cache_tool/CacheTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ Cache::loadSpanConfig(ts::file::path const &path)
if (line.empty() || '#' == *line) {
continue;
}
ts::TextView path = line.take_prefix_if(&isspace);
if (path) {
ts::TextView localpath = line.take_prefix_if(&isspace);
if (localpath) {
// After this the line is [size] [id=string] [volume=#]
while (line) {
ts::TextView value(line.take_prefix_if(&isspace));
Expand All @@ -539,7 +539,7 @@ Cache::loadSpanConfig(ts::file::path const &path)
}
}
}
zret = this->loadSpan(ts::file::path(path));
zret = this->loadSpan(ts::file::path(localpath));
}
}
} else {
Expand All @@ -552,7 +552,7 @@ Errata
Cache::loadURLs(ts::file::path const &path)
{
static const ts::TextView TAG_VOL("url");
ts::URLparser parser;
ts::URLparser loadURLparser;
Errata zret;

std::error_code ec;
Expand All @@ -568,7 +568,7 @@ Cache::loadURLs(ts::file::path const &path)
std::string url;
url.assign(blob.data(), blob.size());
int port_ptr = -1, port_len = -1;
int port = parser.getPort(url, port_ptr, port_len);
int port = loadURLparser.getPort(url, port_ptr, port_len);
if (port_ptr >= 0 && port_len > 0) {
url.erase(port_ptr, port_len + 1); // get rid of :PORT
}
Expand Down
12 changes: 6 additions & 6 deletions src/traffic_logcat/logcat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,31 +208,31 @@ process_file(int in_fd, int out_fd)
}

static int
open_output_file(char *output_file)
open_output_file(char *output_file_p)
{
int file_desc = 0;

if (!overwrite_existing_file) {
if (access(output_file, F_OK)) {
if (access(output_file_p, F_OK)) {
if (errno != ENOENT) {
fprintf(stderr, "Error accessing output file %s: ", output_file);
fprintf(stderr, "Error accessing output file %s: ", output_file_p);
perror(nullptr);
file_desc = -1;
}
} else {
fprintf(stderr,
"Error, output file %s already exists.\n"
"Select a different filename or use the -w flag\n",
output_file);
output_file_p);
file_desc = -1;
}
}

if (file_desc == 0) {
file_desc = open(output_file, O_WRONLY | O_TRUNC | O_CREAT, 0640);
file_desc = open(output_file_p, O_WRONLY | O_TRUNC | O_CREAT, 0640);

if (file_desc < 0) {
fprintf(stderr, "Error while opening output file %s: ", output_file);
fprintf(stderr, "Error while opening output file %s: ", output_file_p);
perror(nullptr);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/traffic_server/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6783,19 +6783,19 @@ TSHttpConnectTransparent(sockaddr const *client_addr, sockaddr const *server_add
void
TSActionCancel(TSAction actionp)
{
Action *a;
Action *thisaction;
INKContInternal *i;

/* This is a hack. Should be handled in ink_types */
if ((uintptr_t)actionp & 0x1) {
a = (Action *)((uintptr_t)actionp - 1);
i = (INKContInternal *)a->continuation;
thisaction = (Action *)((uintptr_t)actionp - 1);
i = (INKContInternal *)thisaction->continuation;
i->handle_event_count(EVENT_IMMEDIATE);
} else {
a = (Action *)actionp;
thisaction = (Action *)actionp;
}

a->cancel();
thisaction->cancel();
}

// Currently no error handling necessary, actionp can be anything.
Expand Down
18 changes: 9 additions & 9 deletions src/traffic_server/traffic_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1641,27 +1641,27 @@ change_uid_gid(const char *user)
* This must work without the ability to elevate privilege if the files are accessible without.
*/
void
bind_outputs(const char *bind_stdout, const char *bind_stderr)
bind_outputs(const char *bind_stdout_p, const char *bind_stderr_p)
{
int log_fd;
unsigned int flags = O_WRONLY | O_APPEND | O_CREAT | O_SYNC;

if (*bind_stdout != 0) {
Debug("log", "binding stdout to %s", bind_stdout);
log_fd = elevating_open(bind_stdout, flags, 0644);
if (*bind_stdout_p != 0) {
Debug("log", "binding stdout to %s", bind_stdout_p);
log_fd = elevating_open(bind_stdout_p, flags, 0644);
if (log_fd < 0) {
fprintf(stdout, "[Warning]: TS unable to open log file \"%s\" [%d '%s']\n", bind_stdout, errno, strerror(errno));
fprintf(stdout, "[Warning]: TS unable to open log file \"%s\" [%d '%s']\n", bind_stdout_p, errno, strerror(errno));
} else {
Debug("log", "duping stdout");
dup2(log_fd, STDOUT_FILENO);
close(log_fd);
}
}
if (*bind_stderr != 0) {
Debug("log", "binding stderr to %s", bind_stderr);
log_fd = elevating_open(bind_stderr, O_WRONLY | O_APPEND | O_CREAT | O_SYNC, 0644);
if (*bind_stderr_p != 0) {
Debug("log", "binding stderr to %s", bind_stderr_p);
log_fd = elevating_open(bind_stderr_p, O_WRONLY | O_APPEND | O_CREAT | O_SYNC, 0644);
if (log_fd < 0) {
fprintf(stdout, "[Warning]: TS unable to open log file \"%s\" [%d '%s']\n", bind_stderr, errno, strerror(errno));
fprintf(stdout, "[Warning]: TS unable to open log file \"%s\" [%d '%s']\n", bind_stderr_p, errno, strerror(errno));
} else {
Debug("log", "duping stderr");
dup2(log_fd, STDERR_FILENO);
Expand Down
Loading