You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/05/23 17:28:16 UTC
[2/3] TS-2547 Remove Resources.c/h, and NEW as well
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/api/GenericParser.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/GenericParser.cc b/mgmt/api/GenericParser.cc
index 151b771..49ec6fc 100644
--- a/mgmt/api/GenericParser.cc
+++ b/mgmt/api/GenericParser.cc
@@ -238,7 +238,7 @@ Rule::arm_securityParse(char *rule)
tok_iter_state ruleTok_state;
const char *tokenStr = ruleTok.iterFirst(&ruleTok_state);
Token *token = (Token *) NULL;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
// ASSUMPTIONS:
// every token starts with a non-digit character is a "name"
@@ -255,7 +255,7 @@ Rule::arm_securityParse(char *rule)
m_tokenList->enqueue(token);
}
- token = NEW(new Token()); // Create a new token
+ token = new Token(); // Create a new token
token->setName(tokenStr); // Set token Name
} else if (token != (Token *) NULL) {
// it is a value or part of a value
@@ -307,7 +307,7 @@ Rule::cacheParse(char *rule, unsigned short minNumToken, unsigned short maxNumTo
return NULL;
}
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
@@ -323,7 +323,7 @@ Rule::cacheParse(char *rule, unsigned short minNumToken, unsigned short maxNumTo
return NULL;
}
- token = NEW(new Token());
+ token = new Token();
/* set the name */
token->setName(subtoken);
@@ -405,7 +405,7 @@ Rule::icpParse(char *rule, unsigned short minNumToken, unsigned short maxNumToke
tok_iter_state ruleTok_state;
const char *tokenStr = ruleTok.iterFirst(&ruleTok_state);
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
// Sanity Check -- number of token
if (numRuleTok < minNumToken) {
@@ -420,7 +420,7 @@ Rule::icpParse(char *rule, unsigned short minNumToken, unsigned short maxNumToke
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
}
@@ -462,8 +462,8 @@ Rule::log_hostsParse(char *rule)
return NULL;
}
- Token *token = NEW(new Token());
- TokenList *m_tokenList = NEW(new TokenList());
+ Token *token = new Token();
+ TokenList *m_tokenList = new TokenList();
token->setName(rule);
m_tokenList->enqueue(token);
@@ -512,10 +512,10 @@ Rule::pluginParse(char *rule)
tok_iter_state ruleTok_state;
const char *tokenStr = ruleTok.iterFirst(&ruleTok_state);
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
}
@@ -541,14 +541,14 @@ Rule::remapParse(char *rule)
}
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
tokenStr = ruleTok.iterNext(&ruleTok_state);
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
tokenStr = ruleTok.iterNext(&ruleTok_state);
token->setValue(tokenStr);
@@ -557,7 +557,7 @@ Rule::remapParse(char *rule)
// Just to make sure that there are no left overs
tokenStr = ruleTok.iterNext(&ruleTok_state);
if (tokenStr) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
ruleTok.iterNext(&ruleTok_state);
@@ -586,12 +586,12 @@ Rule::socksParse(char *rule)
return NULL;
}
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
/* check which rule type it is */
if (strcmp(tokenStr, "no_socks") == 0) { /* TS_SOCKS_BYPASS rule type */
/* the token name = "no socks", the value = "list of ip addresses" */
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
for (; (tokenStr = ruleTok.iterNext(&ruleTok_state));) {
@@ -602,7 +602,7 @@ Rule::socksParse(char *rule)
/* first token: name = "auth", value = "u"
second token: name = <username>
third token: name = <password> */
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
tokenStr = ruleTok.iterNext(&ruleTok_state);
token->setValue(tokenStr); /* should be "u" authoriziation type */
@@ -610,7 +610,7 @@ Rule::socksParse(char *rule)
/* create tokens for username and password */
for (; (tokenStr = ruleTok.iterNext(&ruleTok_state));) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
}
@@ -630,7 +630,7 @@ Rule::socksParse(char *rule)
return NULL;
}
- token = NEW(new Token());
+ token = new Token();
/* set the name */
token->setName(subtoken);
@@ -713,7 +713,7 @@ Rule::splitdnsParse(char *rule)
return NULL;
}
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
@@ -729,7 +729,7 @@ Rule::splitdnsParse(char *rule)
return NULL;
}
- token = NEW(new Token());
+ token = new Token();
token->setName(subtoken);
subtoken = subruleTok.iterNext(&subruleTok_state);
@@ -786,10 +786,10 @@ Rule::updateParse(char *rule)
}
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
}
@@ -812,10 +812,10 @@ Rule::vaddrsParse(char *rule)
tok_iter_state ruleTok_state;
const char *tokenStr = ruleTok.iterFirst(&ruleTok_state);
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
for (; tokenStr; tokenStr = ruleTok.iterNext(&ruleTok_state)) {
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
m_tokenList->enqueue(token);
}
@@ -844,10 +844,10 @@ Rule::storageParse(char *rule)
}
Token *token;
- TokenList *m_tokenList = NEW(new TokenList());
+ TokenList *m_tokenList = new TokenList();
// at least one token, anyways
- token = NEW(new Token());
+ token = new Token();
token->setName(tokenStr);
if (numRuleTok > 1) { // numRulTok == 2
tokenStr = ruleTok.iterNext(&ruleTok_state);
@@ -990,7 +990,7 @@ RuleList::parse(char *fileBuf, TSFileNameT filetype)
lineTok.Initialize(fileBuf);
line = lineTok.iterFirst(&lineTok_state);
while (line) {
- Rule *rule = NEW(new Rule());
+ Rule *rule = new Rule();
if (line[0] == '#') { // is this comment
rule->setComment(line);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/api/NetworkUtilsRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/NetworkUtilsRemote.cc b/mgmt/api/NetworkUtilsRemote.cc
index d7c4ef1..b0038da 100644
--- a/mgmt/api/NetworkUtilsRemote.cc
+++ b/mgmt/api/NetworkUtilsRemote.cc
@@ -36,6 +36,7 @@
#include "ink_defs.h"
#include "ink_sock.h"
#include "ink_string.h"
+#include "ink_memory.h"
#include "I_Layout.h"
#include "NetworkUtilsRemote.h"
#include "CoreAPI.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 0fac4ea..fceb0dc 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -1084,8 +1084,7 @@ insert_locals(textBuffer * rec_cfg_new, textBuffer * rec_cfg, MgmtHashTable * lo
bool eof;
InkHashTableEntry *hte;
InkHashTableIteratorState htis;
- MgmtHashTable *local_access_ht = NEW(new MgmtHashTable("local_access_ht", false,
- InkHashTableKeyType_String));
+ MgmtHashTable *local_access_ht = new MgmtHashTable("local_access_ht", false, InkHashTableKeyType_String);
p = rec_cfg->bufPtr();
for (eof = false; !eof;) {
line = q = p;
@@ -1205,10 +1204,10 @@ ClusterCom::handleMultiCastFilePacket(char *last, char *ip)
if (rb->getVersion(our_ver, &our_rec_cfg) != OK_ROLLBACK) {
file_update_failure = true;
} else {
- our_locals_ht = NEW(new MgmtHashTable("our_locals_ht", true, InkHashTableKeyType_String));
+ our_locals_ht = new MgmtHashTable("our_locals_ht", true, InkHashTableKeyType_String);
our_rec_cfg_cp = ats_strdup(our_rec_cfg->bufPtr());
extract_locals(our_locals_ht, our_rec_cfg_cp);
- reply_new = NEW(new textBuffer(reply->spaceUsed()));
+ reply_new = new textBuffer(reply->spaceUsed());
if (!insert_locals(reply_new, reply, our_locals_ht)) {
file_update_failure = true;
delete reply_new;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/stats/StatProcessor.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatProcessor.cc b/mgmt/stats/StatProcessor.cc
index aeee702..000209e 100644
--- a/mgmt/stats/StatProcessor.cc
+++ b/mgmt/stats/StatProcessor.cc
@@ -82,7 +82,7 @@ elementStart(void * /* userData ATS_UNUSED */, const xmlchar *name, const xmlcha
switch (currentTag) {
case STAT_TAG:
- statObject = NEW(new StatObject(++statCount));
+ statObject = new StatObject(++statCount);
Debug(MODULE_INIT, "\nStat #: ----------------------- %d -----------------------\n", statCount);
if (atts)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/stats/StatType.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatType.cc b/mgmt/stats/StatType.cc
index 1dbda77..1c51b95 100644
--- a/mgmt/stats/StatType.cc
+++ b/mgmt/stats/StatType.cc
@@ -75,7 +75,7 @@ StatExprToken::copy(const StatExprToken & source)
m_token_value_max = source.m_token_value_max;
if (source.m_token_value_delta) {
- m_token_value_delta = NEW(new StatDataSamples());
+ m_token_value_delta = new StatDataSamples();
m_token_value_delta->previous_time = source.m_token_value_delta->previous_time;
m_token_value_delta->current_time = source.m_token_value_delta->current_time;
m_token_value_delta->previous_value = source.m_token_value_delta->previous_value;
@@ -477,7 +477,7 @@ StatObject::assignDst(const char *str, bool m_node_var, bool m_sum_var)
Debug(MODULE_INIT, "DESTINTATION: %s\n", str);
}
- StatExprToken *statToken = NEW(new StatExprToken());
+ StatExprToken *statToken = new StatExprToken();
statToken->assignTokenName(str);
statToken->m_node_var = m_node_var;
@@ -533,11 +533,11 @@ StatObject::assignExpr(char *str)
const char *token = exprTok.iterFirst(&exprTok_state);
ink_assert(m_expression == NULL);
- m_expression = NEW(new StatExprList());
+ m_expression = new StatExprList();
while (token) {
- statToken = NEW(new StatExprToken());
+ statToken = new StatExprToken();
if (isOperator(token[0])) {
@@ -556,7 +556,7 @@ StatObject::assignExpr(char *str)
if (token[0] == '#') {
token += 1; // skip '#'
- statToken->m_token_value_delta = NEW(new StatDataSamples());
+ statToken->m_token_value_delta = new StatDataSamples();
statToken->m_token_value_delta->previous_time = (ink_hrtime) 0;
statToken->m_token_value_delta->current_time = (ink_hrtime) 0;
statToken->m_token_value_delta->data_type = RECD_NULL;
@@ -597,7 +597,7 @@ StatObject::infix2postfix()
StatExprList stack;
StatExprToken *tempToken = NULL;
StatExprToken *curToken = NULL;
- m_postfix = NEW(new StatExprList());
+ m_postfix = new StatExprList();
while (m_expression->top()) {
curToken = m_expression->dequeue();
@@ -707,7 +707,7 @@ RecData StatObject::NodeStatEval(RecDataT *result_type, bool cluster)
/* standard postfix evaluation */
for (StatExprToken * token = m_postfix->first(); token; token = m_postfix->next(token)) {
/* carbon-copy the token. */
- curToken = NEW(new StatExprToken());
+ curToken = new StatExprToken();
curToken->copy(*token);
if (!isOperator(curToken->m_arith_symbol)) {
@@ -859,7 +859,7 @@ StatExprToken *StatObject::StatBinaryEval(StatExprToken * left, char op,
StatExprToken * right, bool cluster)
{
RecData l, r;
- StatExprToken *result = NEW(new StatExprToken());
+ StatExprToken *result = new StatExprToken();
result->m_token_type = RECD_INT;
if (left->m_token_type == RECD_NULL
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/utils/MgmtHashTable.h
----------------------------------------------------------------------
diff --git a/mgmt/utils/MgmtHashTable.h b/mgmt/utils/MgmtHashTable.h
index 1c5274a..5718dba 100644
--- a/mgmt/utils/MgmtHashTable.h
+++ b/mgmt/utils/MgmtHashTable.h
@@ -33,7 +33,7 @@
#ifndef _MGMT_HASH_TABLE_H
#define _MGMT_HASH_TABLE_H
-//#include "libts.h"
+#include "ink_memory.h"
#include "ink_hash_table.h"
#include "ink_mutex.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/mgmt/web2/WebHttpContext.cc
----------------------------------------------------------------------
diff --git a/mgmt/web2/WebHttpContext.cc b/mgmt/web2/WebHttpContext.cc
index f2f86f4..cc09a6b 100644
--- a/mgmt/web2/WebHttpContext.cc
+++ b/mgmt/web2/WebHttpContext.cc
@@ -50,11 +50,11 @@ WebHttpContextCreate(WebHttpConInfo * whci)
// memset to 0; note strings are zero'd too
memset(whc, 0, sizeof(WebHttpContext));
- whc->request = NEW(new httpMessage());
- whc->response_hdr = NEW(new httpResponse());
- whc->response_bdy = NEW(new textBuffer(8192));
- whc->submit_warn = NEW(new textBuffer(256));
- whc->submit_note = NEW(new textBuffer(256));
+ whc->request = new httpMessage();
+ whc->response_hdr = new httpResponse();
+ whc->response_bdy = new textBuffer(8192);
+ whc->submit_warn = new textBuffer(256);
+ whc->submit_note = new textBuffer(256);
whc->submit_warn_ht = ink_hash_table_create(InkHashTableKeyType_String);
whc->submit_note_ht = ink_hash_table_create(InkHashTableKeyType_String);
whc->si.fd = whci->fd;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/AbstractBuffer.cc
----------------------------------------------------------------------
diff --git a/proxy/AbstractBuffer.cc b/proxy/AbstractBuffer.cc
index 92cd6c3..56aceb6 100644
--- a/proxy/AbstractBuffer.cc
+++ b/proxy/AbstractBuffer.cc
@@ -190,7 +190,7 @@ AbstractBuffer::initialize()
ink_assert(vs.s.reader_count == 0);
if (!unaligned_buffer) {
- unaligned_buffer = NEW(new char[size + 511]);
+ unaligned_buffer = new char[size + 511];
buffer = (char *) align_pointer_forward(unaligned_buffer, 512);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/CacheControl.cc
----------------------------------------------------------------------
diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc
index 3031531..50cb02d 100644
--- a/proxy/CacheControl.cc
+++ b/proxy/CacheControl.cc
@@ -125,7 +125,7 @@ int
cacheControlFile_CB(const char * /* name ATS_UNUSED */, RecDataT /* data_type ATS_UNUSED */,
RecData /* data ATS_UNUSED */, void * /* cookie ATS_UNUSED */)
{
- eventProcessor.schedule_imm(NEW(new CC_UpdateContinuation(reconfig_mutex)), ET_CACHE);
+ eventProcessor.schedule_imm(new CC_UpdateContinuation(reconfig_mutex), ET_CACHE);
return 0;
}
@@ -149,7 +149,7 @@ initCacheControl()
{
ink_assert(CacheControlTable == NULL);
reconfig_mutex = new_ProxyMutex();
- CacheControlTable = NEW(new CC_table("proxy.config.cache.control.filename", modulePrefix, &http_dest_tags));
+ CacheControlTable = new CC_table("proxy.config.cache.control.filename", modulePrefix, &http_dest_tags);
REC_RegisterConfigUpdateFunc("proxy.config.cache.control.filename", cacheControlFile_CB, NULL);
}
@@ -165,8 +165,8 @@ reloadCacheControl()
CC_table *newTable;
Debug("cache_control", "cache.config updated, reloading");
- eventProcessor.schedule_in(NEW(new CC_FreerContinuation(CacheControlTable)), CACHE_CONTROL_TIMEOUT, ET_CACHE);
- newTable = NEW(new CC_table("proxy.config.cache.control.filename", modulePrefix, &http_dest_tags));
+ eventProcessor.schedule_in(new CC_FreerContinuation(CacheControlTable), CACHE_CONTROL_TIMEOUT, ET_CACHE);
+ newTable = new CC_table("proxy.config.cache.control.filename", modulePrefix, &http_dest_tags);
ink_atomic_swap(&CacheControlTable, newTable);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ControlMatcher.cc
----------------------------------------------------------------------
diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc
index 7828e7e..c7d8929 100644
--- a/proxy/ControlMatcher.cc
+++ b/proxy/ControlMatcher.cc
@@ -92,7 +92,7 @@ template<class Data, class Result> HostMatcher<Data, Result>::HostMatcher(const
matcher_name(name),
file_name(filename)
{
- host_lookup = NEW(new HostLookup(name));
+ host_lookup = new HostLookup(name);
}
template<class Data, class Result> HostMatcher<Data, Result>::~HostMatcher()
@@ -137,7 +137,7 @@ template<class Data, class Result> void HostMatcher<Data, Result>::AllocateSpace
host_lookup->AllocateSpace(num_entries);
- data_array = NEW(new Data[num_entries]);
+ data_array = new Data[num_entries];
array_len = num_entries;
num_el = 0;
@@ -274,9 +274,9 @@ template<class Data, class Result> void UrlMatcher<Data, Result>::AllocateSpace(
// Should not have been allocated before
ink_assert(array_len == -1);
- data_array = NEW(new Data[num_entries]);
- url_value = NEW(new int [num_entries]);
- url_str = NEW(new char *[num_entries]);
+ data_array = new Data[num_entries];
+ url_value = new int [num_entries];
+ url_str = new char *[num_entries];
memset(url_str, 0, sizeof(char *) * num_entries);
array_len = num_entries;
num_el = 0;
@@ -415,9 +415,9 @@ template<class Data, class Result> void RegexMatcher<Data, Result>::AllocateSpac
re_array = (pcre**)ats_malloc(sizeof(pcre*) * num_entries);
memset(re_array, 0, sizeof(pcre*) * num_entries);
- data_array = NEW(new Data[num_entries]);
+ data_array = new Data[num_entries];
- re_str = NEW(new char *[num_entries]);
+ re_str = new char *[num_entries];
memset(re_str, 0, sizeof(char *) * num_entries);
array_len = num_entries;
@@ -598,7 +598,7 @@ template<class Data, class Result> void IpMatcher<Data, Result>::AllocateSpace(i
// Should not have been allocated before
ink_assert(array_len == -1);
- data_array = NEW(new Data[num_entries]);
+ data_array = new Data[num_entries];
array_len = num_entries;
num_el = 0;
@@ -887,27 +887,27 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTableF
}
// Now allocate space for the record pointers
if ((flags & ALLOW_REGEX_TABLE) && regex > 0) {
- reMatch = NEW((new RegexMatcher<Data, Result> (matcher_name, config_file_path)));
+ reMatch = new RegexMatcher<Data, Result> (matcher_name, config_file_path);
reMatch->AllocateSpace(regex);
}
if ((flags & ALLOW_URL_TABLE) && url > 0) {
- urlMatch = NEW((new UrlMatcher<Data, Result> (matcher_name, config_file_path)));
+ urlMatch = new UrlMatcher<Data, Result> (matcher_name, config_file_path);
urlMatch->AllocateSpace(url);
}
if ((flags & ALLOW_HOST_TABLE) && hostDomain > 0) {
- hostMatch = NEW((new HostMatcher<Data, Result> (matcher_name, config_file_path)));
+ hostMatch = new HostMatcher<Data, Result> (matcher_name, config_file_path);
hostMatch->AllocateSpace(hostDomain);
}
if ((flags & ALLOW_IP_TABLE) && ip > 0) {
- ipMatch = NEW((new IpMatcher<Data, Result> (matcher_name, config_file_path)));
+ ipMatch = new IpMatcher<Data, Result> (matcher_name, config_file_path);
ipMatch->AllocateSpace(ip);
}
if ((flags & ALLOW_HOST_REGEX_TABLE) && hostregex > 0) {
- hrMatch = NEW((new HostRegexMatcher<Data, Result> (matcher_name, config_file_path)));
+ hrMatch = new HostRegexMatcher<Data, Result> (matcher_name, config_file_path);
hrMatch->AllocateSpace(hostregex);
}
// Traverse the list and build the records table
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ICP.cc
----------------------------------------------------------------------
diff --git a/proxy/ICP.cc b/proxy/ICP.cc
index 8124a44..caed7c4 100644
--- a/proxy/ICP.cc
+++ b/proxy/ICP.cc
@@ -710,13 +710,9 @@ ICPPeerReadCont::PeerReadStateMachine(PeerReadData * s, Event * e)
if (!icp_reply_port) {
icp_reply_port = ntohs(ats_ip_port_cast(&s->_peer->fromaddr));
}
- PeerConfigData *Pcfg = NEW(new PeerConfigData(
- PeerConfigData::CTYPE_SIBLING,
- IpAddr(s->_peer->fromaddr),
- 0,
- icp_reply_port
- ));
- ParentSiblingPeer *P = NEW(new ParentSiblingPeer(PEER_SIBLING, Pcfg, _ICPpr, true));
+ PeerConfigData *Pcfg = new PeerConfigData(PeerConfigData::CTYPE_SIBLING, IpAddr(s->_peer->fromaddr), 0,
+ icp_reply_port);
+ ParentSiblingPeer *P = new ParentSiblingPeer(PEER_SIBLING, Pcfg, _ICPpr, true);
status = _ICPpr->AddPeer(P);
ink_release_assert(status);
status = _ICPpr->AddPeerToSendList(P);
@@ -1316,7 +1312,7 @@ ICPRequestCont::ICPStateMachine(int event, void *d)
if (a != ACTION_IO_ERROR) {
if (a != ACTION_RESULT_DONE) {
if (!pendingActions) {
- pendingActions = NEW(new DynArray<Action *>(&default_action));
+ pendingActions = new DynArray<Action *>(&default_action);
}
(*pendingActions) (npending_actions) = a;
}
@@ -1881,7 +1877,7 @@ ICPProcessor::start()
// Setup ICPProcessor lock, required since ICPProcessor is instantiated
// as static object.
//
- _l = NEW(new AtomicLock());
+ _l = new AtomicLock();
//
// Setup custom allocators
@@ -1897,9 +1893,9 @@ ICPProcessor::start()
//
// Create ICP configuration objects
//
- _ICPConfig = NEW(new ICPConfiguration());
+ _ICPConfig = new ICPConfiguration();
- _mcastCB_handler = NEW(new ICPHandlerCont(this));
+ _mcastCB_handler = new ICPHandlerCont(this);
SET_CONTINUATION_HANDLER(_mcastCB_handler, (ICPHandlerContHandler) & ICPHandlerCont::TossEvent);
@@ -1918,14 +1914,14 @@ ICPProcessor::start()
//
// Start ICP configuration monitor (periodic continuation)
//
- _ICPPeriodic = NEW(new ICPPeriodicCont(this));
+ _ICPPeriodic = new ICPPeriodicCont(this);
SET_CONTINUATION_HANDLER(_ICPPeriodic, (ICPPeriodicContHandler) & ICPPeriodicCont::PeriodicEvent);
_PeriodicEvent = eventProcessor.schedule_every(_ICPPeriodic, HRTIME_MSECONDS(ICPPeriodicCont::PERIODIC_INTERVAL), ET_ICP);
//
// Start ICP receive handler continuation
//
- _ICPHandler = NEW(new ICPHandlerCont(this));
+ _ICPHandler = new ICPHandlerCont(this);
SET_CONTINUATION_HANDLER(_ICPHandler, (ICPHandlerContHandler) & ICPHandlerCont::PeriodicEvent);
_ICPHandlerEvent = eventProcessor.schedule_every(_ICPHandler,
HRTIME_MSECONDS(ICPHandlerCont::ICP_HANDLER_INTERVAL), ET_ICP);
@@ -2028,7 +2024,7 @@ ICPProcessor::BuildPeerList()
// Descriptor for local host, add to PeerList and
// RecvPeerList
//***************************************************
- P = NEW(new ParentSiblingPeer(PEER_LOCAL, Pcfg, this));
+ P = new ParentSiblingPeer(PEER_LOCAL, Pcfg, this);
status = AddPeer(P);
ink_release_assert(status);
status = AddPeerToRecvList(P);
@@ -2055,7 +2051,7 @@ ICPProcessor::BuildPeerList()
//*********************************
// Create multicast peer structure
//*********************************
- mcP = NEW(new MultiCastPeer(Pcfg->GetMultiCastIPAddr(), Pcfg->GetICPPort(), Pcfg->GetMultiCastTTL(), this));
+ mcP = new MultiCastPeer(Pcfg->GetMultiCastIPAddr(), Pcfg->GetICPPort(), Pcfg->GetMultiCastTTL(), this);
status = AddPeer(mcP);
ink_assert(status);
status = AddPeerToSendList(mcP);
@@ -2066,7 +2062,7 @@ ICPProcessor::BuildPeerList()
//*****************************
// Add child to MultiCast peer
//*****************************
- P = NEW(new ParentSiblingPeer(type, Pcfg, this));
+ P = new ParentSiblingPeer(type, Pcfg, this);
status = AddPeer(P);
ink_assert(status);
status = ((MultiCastPeer *) mcP)->AddMultiCastChild(P);
@@ -2076,7 +2072,7 @@ ICPProcessor::BuildPeerList()
//*****************************
// Add parent/sibling peer
//*****************************
- P = NEW(new ParentSiblingPeer(type, Pcfg, this));
+ P = new ParentSiblingPeer(type, Pcfg, this);
status = AddPeer(P);
ink_assert(status);
status = AddPeerToSendList(P);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ICPConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/ICPConfig.cc b/proxy/ICPConfig.cc
index 2463050..b648585 100644
--- a/proxy/ICPConfig.cc
+++ b/proxy/ICPConfig.cc
@@ -200,7 +200,7 @@ BitMap::BitMap(int bitmap_maxsize)
_bitmap_byte_size = STATIC_BITMAP_BYTE_SIZE;
} else {
_bitmap_byte_size = (bitmap_maxsize + (BITS_PER_BYTE - 1)) / BITS_PER_BYTE;
- _bitmap = NEW(new char[_bitmap_byte_size]);
+ _bitmap = new char[_bitmap_byte_size];
_bitmap_size = bitmap_maxsize;
}
memset((void *) _bitmap, 0, _bitmap_byte_size);
@@ -380,8 +380,8 @@ ICPConfiguration::ICPConfiguration():_icp_config_callouts(0)
//*********************************************************
// Allocate working and current ICPConfigData structures
//*********************************************************
- _icp_cdata = NEW(new ICPConfigData());
- _icp_cdata_current = NEW(new ICPConfigData());
+ _icp_cdata = new ICPConfigData();
+ _icp_cdata_current = new ICPConfigData();
//********************************************************************
// Read ICP config and setup update callbacks for "icp_cdata_current"
@@ -402,8 +402,8 @@ ICPConfiguration::ICPConfiguration():_icp_config_callouts(0)
// Allocate working and current PeerConfigData structures
//**********************************************************
for (int n = 0; n <= MAX_DEFINED_PEERS; ++n) {
- _peer_cdata[n] = NEW(new PeerConfigData);
- _peer_cdata_current[n] = NEW(new PeerConfigData);
+ _peer_cdata[n] = new PeerConfigData;
+ _peer_cdata_current[n] = new PeerConfigData;
}
//*********************************************************
@@ -494,7 +494,7 @@ ICPConfiguration::mgr_icp_config_change_callback(const char * /* name ATS_UNUSED
// Map this manager configuration callout onto ET_ICP
- ICPConfigUpdateCont *rh = NEW(new ICPConfigUpdateCont(cookie, data.rec_string));
+ ICPConfigUpdateCont *rh = new ICPConfigUpdateCont(cookie, data.rec_string);
SET_CONTINUATION_HANDLER(rh, (ICPCfgContHandler) & ICPConfigUpdateCont::RetryICPconfigUpdate);
eventProcessor.schedule_imm(rh, ET_ICP);
return EVENT_DONE;
@@ -527,7 +527,7 @@ ICPConfiguration::icp_config_change_callback(void *data, void *value, int startu
//
if (!startup && !ICPconfig->Lock()) {
// Build retry continuation
- ICPConfigUpdateCont *rh = NEW(new ICPConfigUpdateCont(data, value));
+ ICPConfigUpdateCont *rh = new ICPConfigUpdateCont(data, value);
SET_CONTINUATION_HANDLER(rh, (ICPCfgContHandler) & ICPConfigUpdateCont::RetryICPconfigUpdate);
eventProcessor.schedule_in(rh, HRTIME_MSECONDS(ICPConfigUpdateCont::RETRY_INTERVAL), ET_ICP);
return EVENT_DONE;
@@ -538,7 +538,7 @@ ICPConfiguration::icp_config_change_callback(void *data, void *value, int startu
//
// Allocate working buffer for PeerConfigData[]
//
- PeerConfigData *P = NEW(new PeerConfigData[MAX_DEFINED_PEERS + 1]);
+ PeerConfigData *P = new PeerConfigData[MAX_DEFINED_PEERS + 1];
//
// Build pathname to "icp.config" and open file
@@ -1208,7 +1208,7 @@ ICPPeriodicCont::PeriodicEvent(int /* event ATS_UNUSED */, Event * /* e ATS_UNUS
//
// We have a configuration change, create worker continuation.
//
- ICPPeriodicCont *rc = NEW(new ICPPeriodicCont(_ICPpr));
+ ICPPeriodicCont *rc = new ICPPeriodicCont(_ICPpr);
SET_CONTINUATION_HANDLER(rc, (ICPPeriodicContHandler) & ICPPeriodicCont::DoReconfigAction);
eventProcessor.schedule_imm(rc);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/IPAllow.cc
----------------------------------------------------------------------
diff --git a/proxy/IPAllow.cc b/proxy/IPAllow.cc
index 07c9eee..de2a72f 100644
--- a/proxy/IPAllow.cc
+++ b/proxy/IPAllow.cc
@@ -64,7 +64,7 @@ IpAllow::startup()
ALL_METHOD_MASK = ~0;
- ipAllowUpdate = NEW(new ConfigUpdateHandler<IpAllow>());
+ ipAllowUpdate = new ConfigUpdateHandler<IpAllow>();
ipAllowUpdate->attach("proxy.config.cache.ip_allow.filename");
reconfigure();
@@ -77,7 +77,7 @@ IpAllow::reconfigure()
Note("ip_allow.config updated, reloading");
- new_table = NEW(new self("proxy.config.cache.ip_allow.filename", "IpAllow", "ip_allow"));
+ new_table = new self("proxy.config.cache.ip_allow.filename", "IpAllow", "ip_allow");
new_table->BuildTable();
configid = configProcessor.set(configid, new_table);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 429a47a..0182ebe 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -1321,7 +1321,7 @@ ConfigUpdateCbTable::invoke(const char *name)
void
ConfigUpdateCbTable::invoke(INKContInternal *contp)
{
- eventProcessor.schedule_imm(NEW(new ConfigUpdateCallback(contp)), ET_TASK);
+ eventProcessor.schedule_imm(new ConfigUpdateCallback(contp), ET_TASK);
}
////////////////////////////////////////////////////////////////////
@@ -1588,9 +1588,9 @@ api_init()
TS_HTTP_LEN_PUBLIC = HTTP_LEN_PUBLIC;
TS_HTTP_LEN_S_MAXAGE = HTTP_LEN_S_MAXAGE;
- http_global_hooks = NEW(new HttpAPIHooks);
- lifecycle_hooks = NEW(new LifecycleAPIHooks);
- global_config_cbs = NEW(new ConfigUpdateCbTable);
+ http_global_hooks = new HttpAPIHooks;
+ lifecycle_hooks = new LifecycleAPIHooks;
+ global_config_cbs = new ConfigUpdateCbTable;
if (TS_MAX_API_STATS > 0) {
api_rsb = RecAllocateRawStatBlock(TS_MAX_API_STATS);
@@ -1804,7 +1804,7 @@ TSfopen(const char *filename, const char *mode)
{
FileImpl *file;
- file = NEW(new FileImpl);
+ file = new FileImpl;
if (!file->fopen(filename, mode)) {
delete file;
return NULL;
@@ -1899,7 +1899,7 @@ TSMBuffer
TSMBufferCreate(void)
{
TSMBuffer bufp;
- HdrHeapSDKHandle *new_heap = NEW(new HdrHeapSDKHandle);
+ HdrHeapSDKHandle *new_heap = new HdrHeapSDKHandle;
new_heap->m_heap = new_HdrHeap();
bufp = (TSMBuffer)new_heap;
@@ -3901,7 +3901,7 @@ sdk_sanity_check_cachekey(TSCacheKey key)
TSCacheKey
TSCacheKeyCreate(void)
{
- TSCacheKey key = (TSCacheKey)NEW(new CacheInfo());
+ TSCacheKey key = (TSCacheKey)new CacheInfo();
// TODO: Probably remove this when we can be use "NEW" can't fail.
sdk_assert(sdk_sanity_check_cachekey(key) == TS_SUCCESS);
@@ -4008,7 +4008,7 @@ TSCacheKeyDestroy(TSCacheKey key)
TSCacheHttpInfo
TSCacheHttpInfoCopy(TSCacheHttpInfo infop)
{
- CacheHTTPInfo *new_info = NEW(new CacheHTTPInfo);
+ CacheHTTPInfo *new_info = new CacheHTTPInfo;
new_info->copy((CacheHTTPInfo *) infop);
return reinterpret_cast<TSCacheHttpInfo>(new_info);
@@ -4123,7 +4123,7 @@ TSCacheHttpInfoCreate(void)
unsigned int
TSConfigSet(unsigned int id, void *data, TSConfigDestroyFunc funcp)
{
- INKConfigImpl *config = NEW(new INKConfigImpl);
+ INKConfigImpl *config = new INKConfigImpl;
config->mdata = data;
config->m_destroy_func = funcp;
return configProcessor.set(id, config);
@@ -4467,11 +4467,11 @@ TSHttpSsnReenable(TSHttpSsn ssnp, TSEvent event)
// which is DEDICATED, the continuation needs to be called back on a
// REGULAR thread.
if (eth->tt != REGULAR) {
- eventProcessor.schedule_imm(NEW(new TSHttpSsnCallback(cs, event)), ET_NET);
+ eventProcessor.schedule_imm(new TSHttpSsnCallback(cs, event), ET_NET);
} else {
MUTEX_TRY_LOCK(trylock, cs->mutex, eth);
if (!trylock) {
- eventProcessor.schedule_imm(NEW(new TSHttpSsnCallback(cs, event)), ET_NET);
+ eventProcessor.schedule_imm(new TSHttpSsnCallback(cs, event), ET_NET);
} else {
cs->handleEvent((int) event, 0);
}
@@ -5534,11 +5534,11 @@ TSHttpTxnReenable(TSHttpTxn txnp, TSEvent event)
// which is DEDICATED, the continuation needs to be called back on a
// REGULAR thread.
if (eth == NULL || eth->tt != REGULAR) {
- eventProcessor.schedule_imm(NEW(new TSHttpSMCallback(sm, event)), ET_NET);
+ eventProcessor.schedule_imm(new TSHttpSMCallback(sm, event), ET_NET);
} else {
MUTEX_TRY_LOCK(trylock, sm->mutex, eth);
if (!trylock) {
- eventProcessor.schedule_imm(NEW(new TSHttpSMCallback(sm, event)), ET_NET);
+ eventProcessor.schedule_imm(new TSHttpSMCallback(sm, event), ET_NET);
} else {
sm->state_api_callback((int) event, 0);
}
@@ -6806,14 +6806,14 @@ TSTextLogObjectCreate(const char *filename, int mode, TSTextLogObject *new_objec
return TS_ERROR;
}
- TextLogObject *tlog = NEW(new TextLogObject(filename, Log::config->logfile_dir,
- (bool) mode & TS_LOG_MODE_ADD_TIMESTAMP,
- NULL,
- Log::config->rolling_enabled,
- Log::config->collation_preproc_threads,
- Log::config->rolling_interval_sec,
- Log::config->rolling_offset_hr,
- Log::config->rolling_size_mb));
+ TextLogObject *tlog = new TextLogObject(filename, Log::config->logfile_dir,
+ (bool) mode & TS_LOG_MODE_ADD_TIMESTAMP,
+ NULL,
+ Log::config->rolling_enabled,
+ Log::config->collation_preproc_threads,
+ Log::config->rolling_interval_sec,
+ Log::config->rolling_offset_hr,
+ Log::config->rolling_size_mb);
if (tlog == NULL) {
*new_object = NULL;
return TS_ERROR;
@@ -8501,7 +8501,7 @@ TSHttpTxnCloseAfterResponse (TSHttpTxn txnp, int should_close)
TSPortDescriptor
TSPortDescriptorParse(const char * descriptor)
{
- HttpProxyPort * port = NEW(new HttpProxyPort());
+ HttpProxyPort * port = new HttpProxyPort();
if (descriptor && port->processOptions(descriptor)) {
return (TSPortDescriptor)port;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/InkIOCoreAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkIOCoreAPI.cc b/proxy/InkIOCoreAPI.cc
index 4da1d25..26f3298 100644
--- a/proxy/InkIOCoreAPI.cc
+++ b/proxy/InkIOCoreAPI.cc
@@ -125,7 +125,7 @@ TSThreadCreate(TSThreadFunc func, void *data)
{
INKThreadInternal *thread;
- thread = NEW(new INKThreadInternal);
+ thread = new INKThreadInternal;
ink_assert(thread->event_types == 0);
@@ -144,7 +144,7 @@ TSThreadInit()
{
INKThreadInternal *thread;
- thread = NEW(new INKThreadInternal);
+ thread = new INKThreadInternal;
#ifdef DEBUG
if (thread == NULL)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index bd74d66..55f6339 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -317,7 +317,7 @@ initialize_process_manager()
}
// Start up manager
- pmgmt = NEW(new ProcessManager(remote_management_flag));
+ pmgmt = new ProcessManager(remote_management_flag);
pmgmt->start();
RecProcessInitMessage(remote_management_flag ? RECM_CLIENT : RECM_STAND_ALONE);
@@ -505,7 +505,7 @@ cmd_check_internal(char * /* cmd ATS_UNUSED */, bool fix = false)
printf("\nbad cache configuration, %s failed\n", n);
return CMD_FAILED;
}
- eventProcessor.schedule_every(NEW(new CmdCacheCont(true, fix)), HRTIME_SECONDS(1));
+ eventProcessor.schedule_every(new CmdCacheCont(true, fix), HRTIME_SECONDS(1));
return CMD_IN_PROGRESS;
}
@@ -580,7 +580,7 @@ cmd_clear(char *cmd)
Note("unable to open Cache, CLEAR failed");
return CMD_FAILED;
}
- eventProcessor.schedule_every(NEW(new CmdCacheCont(false)), HRTIME_SECONDS(1));
+ eventProcessor.schedule_every(new CmdCacheCont(false), HRTIME_SECONDS(1));
return CMD_IN_PROGRESS;
}
@@ -1038,7 +1038,7 @@ static void
run_AutoStop()
{
if (getenv("PROXY_AUTO_EXIT"))
- eventProcessor.schedule_in(NEW(new AutoStopCont), HRTIME_SECONDS(atoi(getenv("PROXY_AUTO_EXIT"))));
+ eventProcessor.schedule_in(new AutoStopCont(), HRTIME_SECONDS(atoi(getenv("PROXY_AUTO_EXIT"))));
}
#if TS_HAS_TESTS
@@ -1077,7 +1077,7 @@ static void
run_RegressionTest()
{
if (regression_level)
- eventProcessor.schedule_every(NEW(new RegressionCont), HRTIME_SECONDS(1));
+ eventProcessor.schedule_every(new RegressionCont(), HRTIME_SECONDS(1));
}
#endif //TS_HAS_TESTS
@@ -1310,7 +1310,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
// re-start Diag completely) because at initialize, TM only has 1 thread.
// In TS, some threads have already created, so if we delete Diag and
// re-start it again, TS will crash.
- diagsConfig = NEW(new DiagsConfig(DIAGS_LOG_FILENAME, error_tags, action_tags, false));
+ diagsConfig = new DiagsConfig(DIAGS_LOG_FILENAME, error_tags, action_tags, false);
diags = diagsConfig->diags;
diags->prefix_str = "Server ";
if (is_debug_tag_set("diags"))
@@ -1364,7 +1364,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
// This call is required for win_9xMe
//without this this_ethread() is failing when
//start_HttpProxyServer is called from main thread
- Thread *main_thread = NEW(new EThread);
+ Thread *main_thread = new EThread;
main_thread->set_specific();
// Re-initialize diagsConfig based on records.config configuration
@@ -1372,7 +1372,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
RecDebugOff();
delete(diagsConfig);
}
- diagsConfig = NEW(new DiagsConfig(DIAGS_LOG_FILENAME, error_tags, action_tags, true));
+ diagsConfig = new DiagsConfig(DIAGS_LOG_FILENAME, error_tags, action_tags, true);
diags = diagsConfig->diags;
RecSetDiags(diags);
diags->prefix_str = "Server ";
@@ -1580,7 +1580,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
start_stats_snap();
// Initialize Response Body Factory
- body_factory = NEW(new HttpBodyFactory);
+ body_factory = new HttpBodyFactory;
// Start IP to userName cache processor used
// by RADIUS and FW1 plug-ins.
@@ -1595,7 +1595,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
// Continuation Statistics Dump
if (show_statistics)
- eventProcessor.schedule_every(NEW(new ShowStats), HRTIME_SECONDS(show_statistics), ET_CALL);
+ eventProcessor.schedule_every(new ShowStats(), HRTIME_SECONDS(show_statistics), ET_CALL);
//////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ParentSelection.cc
----------------------------------------------------------------------
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index bb9e4ca..8556148 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -100,7 +100,7 @@ int ParentConfig::m_id = 0;
void
ParentConfig::startup()
{
- parentConfigUpdate = NEW(new ConfigUpdateHandler<ParentConfig>());
+ parentConfigUpdate = new ConfigUpdateHandler<ParentConfig>();
// Load the initial configuration
reconfigure();
@@ -132,10 +132,10 @@ ParentConfig::reconfigure()
int dns_parent_only;
ParentConfigParams *params;
- params = NEW(new ParentConfigParams);
+ params = new ParentConfigParams;
// Allocate parent table
- params->ParentTable = NEW(new P_table(file_var, modulePrefix, &http_dest_tags));
+ params->ParentTable = new P_table(file_var, modulePrefix, &http_dest_tags);
// Handle default parent
PARENT_ReadConfigStringAlloc(default_val, default_var);
@@ -863,7 +863,7 @@ createDefaultParent(char *val)
return NULL;
}
- newRec = NEW(new ParentRecord);
+ newRec = new ParentRecord;
if (newRec->DefaultInit(val) == true) {
return newRec;
} else {
@@ -923,11 +923,11 @@ SocksServerConfig::reconfigure()
int fail_threshold;
ParentConfigParams *params;
- params = NEW(new ParentConfigParams);
+ params = new ParentConfigParams;
// Allocate parent table
- params->ParentTable = NEW(new P_table("proxy.config.socks.socks_config_file", "[Socks Server Selection]",
- &socks_server_tags));
+ params->ParentTable = new P_table("proxy.config.socks.socks_config_file", "[Socks Server Selection]",
+ &socks_server_tags);
// Handle default parent
PARENT_ReadConfigStringAlloc(default_val, "proxy.config.socks.default_servers");
@@ -997,7 +997,7 @@ request_to_data(HttpRequestData * req, sockaddr const* srcip, sockaddr const* ds
ink_zero(req->dest_ip);
ats_ip_copy(&req->dest_ip.sa, dstip);
- req->hdr = NEW(new HTTPHdr);
+ req->hdr = new HTTPHdr;
http_parser_init(&parser);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 9b0727e..2e4cfa1 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -984,7 +984,7 @@ PluginVCCore::~PluginVCCore()
PluginVCCore *
PluginVCCore::alloc()
{
- PluginVCCore *pvc = NEW(new PluginVCCore);
+ PluginVCCore *pvc = new PluginVCCore;
pvc->init();
return pvc;
}
@@ -1271,8 +1271,8 @@ PVCTestDriver::run_next_test()
Debug("pvc_test", "Starting test %s", netvc_tests_def[a_index].test_name);
- NetVCTest *p = NEW(new NetVCTest);
- NetVCTest *a = NEW(new NetVCTest);
+ NetVCTest *p = new NetVCTest;
+ NetVCTest *a = new NetVCTest;
PluginVCCore *core = PluginVCCore::alloc();
core->set_accept_cont(p);
@@ -1296,7 +1296,7 @@ PVCTestDriver::main_handler(int /* event ATS_UNUSED */, void * /* data ATS_UNUSE
EXCLUSIVE_REGRESSION_TEST(PVC) (RegressionTest * t, int /* atype ATS_UNUSED */, int *pstatus)
{
- PVCTestDriver *driver = NEW(new PVCTestDriver);
+ PVCTestDriver *driver = new PVCTestDriver;
driver->start_tests(t, pstatus);
}
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/Prefetch.cc
----------------------------------------------------------------------
diff --git a/proxy/Prefetch.cc b/proxy/Prefetch.cc
index 46fadb6..c1d2b95 100644
--- a/proxy/Prefetch.cc
+++ b/proxy/Prefetch.cc
@@ -341,7 +341,7 @@ PrefetchConfigCont::conf_update_handler(int /* event ATS_UNUSED */, void * /* ed
{
Debug("Prefetch", "Handling Prefetch config change");
- PrefetchConfiguration *new_prefetch_config = NEW(new PrefetchConfiguration);
+ PrefetchConfiguration *new_prefetch_config = new PrefetchConfiguration;
if (new_prefetch_config->readConfiguration() == 0) {
// switch the prefetch_config
eventProcessor.schedule_in(new PrefetchConfigFreerCont(prefetch_config), PREFETCH_CONFIG_UPDATE_TIMEOUT, ET_TASK);
@@ -362,7 +362,7 @@ prefetch_config_cb(const char * /* name ATS_UNUSED */, RecDataT /* data_type ATS
{
INK_MEMORY_BARRIER;
- eventProcessor.schedule_in(NEW(new PrefetchConfigCont(prefetch_reconfig_mutex)), HRTIME_SECONDS(1), ET_TASK);
+ eventProcessor.schedule_in(new PrefetchConfigCont(prefetch_reconfig_mutex), HRTIME_SECONDS(1), ET_TASK);
return 0;
}
@@ -740,7 +740,7 @@ check_n_attach_prefetch_transform(HttpSM *sm, HTTPHdr *resp, bool from_cache)
return;
}
//now insert the parser
- prefetch_trans = NEW(new PrefetchTransform(sm, resp));
+ prefetch_trans = new PrefetchTransform(sm, resp);
if (prefetch_trans) {
Debug("PrefetchParser", "Adding Prefetch Parser 0x%p\n", prefetch_trans);
@@ -804,7 +804,7 @@ PrefetchProcessor::start()
// we need to create the config and register all config callbacks
// first.
prefetch_reconfig_mutex = new_ProxyMutex();
- prefetch_config = NEW(new PrefetchConfiguration);
+ prefetch_config = new PrefetchConfiguration;
RecRegisterConfigUpdateCb("proxy.config.prefetch.prefetch_enabled", prefetch_config_cb, NULL);
RecRegisterConfigUpdateCb("proxy.config.http.server_port", prefetch_config_cb, NULL);
RecRegisterConfigUpdateCb("proxy.config.prefetch.child_port", prefetch_config_cb, NULL);
@@ -827,7 +827,7 @@ PrefetchProcessor::start()
PREFETCH_FIELD_LEN_RECURSION = strlen(PREFETCH_FIELD_RECURSION);
//hdrtoken_wks_to_length(PREFETCH_FIELD_RECURSION);
- g_conn_table = NEW(new KeepAliveConnTable);
+ g_conn_table = new KeepAliveConnTable;
g_conn_table->init();
udp_seq_no = this_ethread()->generator.random();
@@ -1014,7 +1014,7 @@ PrefetchBlaster::init(PrefetchUrlEntry *entry, HTTPHdr *req_hdr, PrefetchTransfo
//int host_pos=-1, path_pos=-1;
int url_len = strlen(entry->url);
- request = NEW(new HTTPHdr);
+ request = new HTTPHdr;
request->copy(req_hdr);
url_clear(request->url_get()->m_url_impl); /* BugID: INKqa11148 */
//request->url_get()->clear();
@@ -2067,7 +2067,7 @@ KeepAliveConn::append(IOBufferReader *rdr)
int
KeepAliveConnTable::init()
{
- arr = NEW(new conn_elem[CONN_ARR_SIZE]);
+ arr = new conn_elem[CONN_ARR_SIZE];
for (int i = 0; i < CONN_ARR_SIZE; i++) {
arr[i].conn = 0;
@@ -2117,7 +2117,7 @@ KeepAliveConnTable::append(IpEndpoint const& ip, MIOBuffer *buf, IOBufferReader
(*conn)->append(reader);
free_MIOBuffer(buf);
} else {
- *conn = NEW(new KeepAliveConn); //change to fast allocator?
+ *conn = new KeepAliveConn; //change to fast allocator?
(*conn)->init(ip, buf, reader);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ProtocolProbeSessionAccept.cc
----------------------------------------------------------------------
diff --git a/proxy/ProtocolProbeSessionAccept.cc b/proxy/ProtocolProbeSessionAccept.cc
index 2c82c7c..46adb48 100644
--- a/proxy/ProtocolProbeSessionAccept.cc
+++ b/proxy/ProtocolProbeSessionAccept.cc
@@ -112,7 +112,7 @@ ProtocolProbeSessionAccept::mainEvent(int event, void *data)
VIO * vio;
NetVConnection * netvc = static_cast<NetVConnection*>(data);
- ProtocolProbeTrampoline * probe = NEW(new ProtocolProbeTrampoline(this, netvc->mutex));
+ ProtocolProbeTrampoline * probe = new ProtocolProbeTrampoline(this, netvc->mutex);
// XXX we need to apply accept inactivity timeout here ...
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/ReverseProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index bdfecbd..a69206a 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -74,7 +74,7 @@ init_reverse_proxy()
{
ink_assert(rewrite_table == NULL);
reconfig_mutex = new_ProxyMutex();
- rewrite_table = NEW(new UrlRewrite());
+ rewrite_table = new UrlRewrite();
if (!rewrite_table->is_valid()) {
Warning("Can not load the remap table, exiting out!");
@@ -158,7 +158,7 @@ reloadUrlRewrite()
UrlRewrite *newTable;
Debug("url_rewrite", "remap.config updated, reloading...");
- newTable = NEW(new UrlRewrite());
+ newTable = new UrlRewrite();
if (newTable->is_valid()) {
new_Deleter(rewrite_table, URL_REWRITE_TIMEOUT);
Debug("url_rewrite", "remap.config done reloading!");
@@ -186,7 +186,7 @@ url_rewrite_CB(const char * /* name ATS_UNUSED */, RecDataT /* data_type ATS_UNU
case DEFAULT_TO_PAC_PORT_CHANGED:
case FILE_CHANGED:
case HTTP_DEFAULT_REDIRECT_CHANGED:
- eventProcessor.schedule_imm(NEW(new UR_UpdateContinuation(reconfig_mutex)), ET_TASK);
+ eventProcessor.schedule_imm(new UR_UpdateContinuation(reconfig_mutex), ET_TASK);
break;
case AC_PORT_CHANGED:
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/SocksProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/SocksProxy.cc b/proxy/SocksProxy.cc
index 64079ca..1658dbb 100644
--- a/proxy/SocksProxy.cc
+++ b/proxy/SocksProxy.cc
@@ -528,7 +528,7 @@ start_SocksProxy(int port)
Debug("SocksProxy", "Accepting SocksProxy connections on port %d\n", port);
NetProcessor::AcceptOptions opt;
opt.local_port = port;
- netProcessor.main_accept(NEW(new SocksAccepter), NO_FD, opt);
+ netProcessor.main_accept(new SocksAccepter(), NO_FD, opt);
socksproxy_stat_block = RecAllocateRawStatBlock(socksproxy_stat_count);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/StatSystem.cc
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.cc b/proxy/StatSystem.cc
index 87647eb..efe6a84 100644
--- a/proxy/StatSystem.cc
+++ b/proxy/StatSystem.cc
@@ -384,9 +384,9 @@ struct SnapCont: public Continuation
void
start_stats_snap()
{
- eventProcessor.schedule_every(NEW(new SnapCont(rusage_snap_mutex)), SNAP_USAGE_PERIOD, ET_CALL);
+ eventProcessor.schedule_every(new SnapCont(rusage_snap_mutex), SNAP_USAGE_PERIOD, ET_CALL);
if (snap_stats_every)
- eventProcessor.schedule_every(NEW(new SnapStatsContinuation()), HRTIME_SECONDS(snap_stats_every), ET_CALL);
+ eventProcessor.schedule_every(new SnapStatsContinuation(), HRTIME_SECONDS(snap_stats_every), ET_CALL);
else
Warning("disabling statistics snap");
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/Transform.cc
----------------------------------------------------------------------
diff --git a/proxy/Transform.cc b/proxy/Transform.cc
index 29be0c2..3df17ed 100644
--- a/proxy/Transform.cc
+++ b/proxy/Transform.cc
@@ -92,7 +92,7 @@ VConnection *
TransformProcessor::open(Continuation *cont, APIHook *hooks)
{
if (hooks) {
- return NEW(new TransformVConnection(cont, hooks));
+ return new TransformVConnection(cont, hooks);
} else {
return NULL;
}
@@ -104,7 +104,7 @@ TransformProcessor::open(Continuation *cont, APIHook *hooks)
INKVConnInternal *
TransformProcessor::null_transform(ProxyMutex *mutex)
{
- return NEW(new NullTransform(mutex));
+ return new NullTransform(mutex);
}
@@ -114,7 +114,7 @@ TransformProcessor::null_transform(ProxyMutex *mutex)
INKVConnInternal *
TransformProcessor::range_transform(ProxyMutex *mut, RangeRecord *ranges, int num_fields, HTTPHdr *transform_resp, const char * content_type, int content_type_len, int64_t content_length)
{
- RangeTransform *range_transform = NEW(new RangeTransform(mut, ranges, num_fields, transform_resp, content_type, content_type_len, content_length));
+ RangeTransform *range_transform = new RangeTransform(mut, ranges, num_fields, transform_resp, content_type, content_type_len, content_length);
return range_transform;
}
@@ -728,7 +728,7 @@ void
TransformTest::run()
{
if (is_action_tag_set("transform_test")) {
- eventProcessor.schedule_imm(NEW(new TransformControl()), ET_NET);
+ eventProcessor.schedule_imm(new TransformControl(), ET_NET);
}
}
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/Update.cc
----------------------------------------------------------------------
diff --git a/proxy/Update.cc b/proxy/Update.cc
index c8c16cd..d4567ce 100644
--- a/proxy/Update.cc
+++ b/proxy/Update.cc
@@ -407,7 +407,7 @@ UpdateEntry::BuildHttpRequest()
} else {
snprintf(request, sizeof(request), "%s%s%s%s", GET_METHOD, _url, HTTP_VERSION, REQUEST_TERMINATOR);
}
- _http_hdr = NEW(new HTTPHdr);
+ _http_hdr = new HTTPHdr;
http_parser_init(&_http_parser);
_http_hdr->create(HTTP_TYPE_REQUEST);
int err;
@@ -605,7 +605,7 @@ UpdateConfigList::HashAdd(UpdateEntry * e)
if (!_hash_table) {
// One time initialization
- _hash_table = NEW(new UpdateEntry *[HASH_TABLE_SIZE]);
+ _hash_table = new UpdateEntry *[HASH_TABLE_SIZE];
memset((char *) _hash_table, 0, (sizeof(UpdateEntry *) * HASH_TABLE_SIZE));
}
// Add to hash table only if unique
@@ -686,10 +686,10 @@ UpdateManager::start()
init_proto_schemes();
init_supported_proto_schemes();
- _CM = NEW(new UpdateConfigManager);
+ _CM = new UpdateConfigManager;
_CM->init();
- _SCH = NEW(new UpdateScheduler(_CM));
+ _SCH = new UpdateScheduler(_CM);
_SCH->Init();
return 0;
@@ -718,7 +718,7 @@ UpdateConfigManager::init()
{
update_rsb = RecAllocateRawStatBlock((int) update_stat_count);
- _CP_actual = NEW(new UpdateConfigParams);
+ _CP_actual = new UpdateConfigParams;
// Setup update handlers for each global configuration parameter
@@ -773,7 +773,7 @@ UpdateConfigManager::init()
// Make working and actual global config copies equal
- _CP = NEW(new UpdateConfigParams(*_CP_actual));
+ _CP = new UpdateConfigParams(*_CP_actual);
// Setup "update.config" update handler
@@ -853,7 +853,7 @@ UpdateConfigManager::ProcessUpdate(int event, Event * e)
// EVENT_INTERVAL -- Global configuration update check
////////////////////////////////////////////////////////////////////
- UpdateConfigParams *p = NEW(new UpdateConfigParams(*_CP_actual));
+ UpdateConfigParams *p = new UpdateConfigParams(*_CP_actual);
if (!(*_CP == *p)) {
_CP = p;
@@ -965,7 +965,7 @@ UpdateConfigManager::ParseConfigFile(int f)
int i;
UpdateEntry *e = NULL;
- UpdateConfigList *ul = NEW(new UpdateConfigList);
+ UpdateConfigList *ul = new UpdateConfigList;
while (GetDataLine(f, sizeof(line) - 1, line, F_ITEMS, '\\') > 0) {
++ln;
@@ -996,7 +996,7 @@ UpdateConfigManager::ParseConfigFile(int f)
}
// Validate data fields
- e = NEW(new UpdateEntry);
+ e = new UpdateEntry;
////////////////////////////////////
// Validate URL
@@ -1144,7 +1144,7 @@ UpdateScheduler::ScheduleEvent(int event, void *e)
// Instantiate UpdateScheduler to process this URL list.
//////////////////////////////////////////////////////////
Debug("update", "Starting UpdateScheduler for id: %d [%s]", ue->_id, ue->_url);
- UpdateScheduler *us = NEW(new UpdateScheduler());
+ UpdateScheduler *us = new UpdateScheduler();
us->Init(this, ue, _CP);
update_complete = 0;
@@ -1364,7 +1364,7 @@ UpdateScheduler::Schedule(UpdateEntry * e)
if (ue) {
++_update_state_machines;
UPDATE_INCREMENT_DYN_STAT(update_state_machines_stat);
- usm = NEW(new UpdateSM(this, _CP, ue));
+ usm = new UpdateSM(this, _CP, ue);
usm->Start();
Debug("update", "%s %s start update id: %d [%s]",
@@ -1527,8 +1527,8 @@ UpdateSM::http_scheme(UpdateSM * sm)
// Recursive Update
////////////////////////////////////
Debug("update", "Start recursive HTTP GET id: %d [%s]", sm->_EN->_id, sm->_EN->_url);
- sm->_EN->_indirect_list = NEW(new UpdateConfigList);
- RecursiveHttpGet *RHttpGet = NEW(new RecursiveHttpGet);
+ sm->_EN->_indirect_list = new UpdateConfigList;
+ RecursiveHttpGet *RHttpGet = new RecursiveHttpGet;
RHttpGet->Init(sm, sm->_EN->_url, sm->_EN->_request_headers,
&sm->_EN->_URLhandle, sm->_EN->_http_hdr,
@@ -1649,7 +1649,7 @@ RecursiveHttpGet::RecursiveHttpGetEvent(int event, Event * d)
while ((status = html_parser.ParseHtml(r, &url, &url_end))) {
// Validate given URL.
- ue = NEW(new UpdateEntry);
+ ue = new UpdateEntry;
if (ue->ValidURL(url, url_end + 1 /* Point to null */ )) {
delete ue;
ue = NULL;
@@ -1746,7 +1746,7 @@ RecursiveHttpGet::RecursiveHttpGetEvent(int event, Event * d)
Debug("update", "(R) start non-terminal HTTP GET rid: %d id: %d [%s]", _id, ue->_id, ue->_url);
_active_child_state_machines++;
- RecursiveHttpGet *RHttpGet = NEW(new RecursiveHttpGet());
+ RecursiveHttpGet *RHttpGet = new RecursiveHttpGet();
RHttpGet->Init(this, ue->_url, _request_headers,
_url_data, _http_hdr, (_recursion_depth - 1), _CL, &update_allowable_html_tags[0]);
return EVENT_CONT;
@@ -2369,7 +2369,7 @@ HtmlParser::MakeURL(char *url, char *sub, int subsize, int relative_url)
int i, n;
int skip_slashslash;
- DynArray<char>*result = NEW(new DynArray<char>(&default_zero_char, 128));
+ DynArray<char>*result = new DynArray<char>(&default_zero_char, 128);
if (relative_url) {
if (*sub != '/') {
@@ -2443,7 +2443,7 @@ HtmlParser::PrependString(const char *pre, int presize, char *sub, int subsize)
{
int n;
- DynArray<char>*result = NEW(new DynArray<char>(&default_zero_char, 128));
+ DynArray<char>*result = new DynArray<char>(&default_zero_char, 128);
for (n = 0; n < presize; ++n) {
(*result) (result->length()) = pre[n];
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/congest/Congestion.cc
----------------------------------------------------------------------
diff --git a/proxy/congest/Congestion.cc b/proxy/congest/Congestion.cc
index f50a535..974e843 100644
--- a/proxy/congest/Congestion.cc
+++ b/proxy/congest/Congestion.cc
@@ -363,7 +363,7 @@ initCongestionControl()
// register the stats variables
register_congest_stats();
- CongestionControlUpdate = NEW(new ConfigUpdateHandler<CongestionMatcherTable>());
+ CongestionControlUpdate = new ConfigUpdateHandler<CongestionMatcherTable>();
// register config variables
REC_EstablishStaticConfigInt32(congestionControlEnabled, "proxy.config.http.congestion_control.enabled");
@@ -402,7 +402,7 @@ void
CongestionMatcherTable::reconfigure()
{
Note("congestion control config changed, reloading");
- CongestionMatcher = NEW(new CongestionMatcherTable("proxy.config.http.congestion_control.filename", congestPrefix, &congest_dest_tags));
+ CongestionMatcher = new CongestionMatcherTable("proxy.config.http.congestion_control.filename", congestPrefix, &congest_dest_tags);
#ifdef DEBUG_CONGESTION_MATCHER
CongestionMatcher->Print();
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/hdrs/HdrTest.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/HdrTest.cc b/proxy/hdrs/HdrTest.cc
index 42af8d9..637a836 100644
--- a/proxy/hdrs/HdrTest.cc
+++ b/proxy/hdrs/HdrTest.cc
@@ -38,7 +38,6 @@
#include "HTTP.h"
#include "MIME.h"
#include "Regex.h"
-#include "Resource.h"
#include "URL.h"
#include "HttpCompat.h"
@@ -153,7 +152,7 @@ HdrTest::test_error_page_selection()
// (1) build fake hash table of sets
- RawHashTable *table_of_sets = NEW(new RawHashTable(RawHashTable_KeyType_String));
+ RawHashTable *table_of_sets = new RawHashTable(RawHashTable_KeyType_String);
for (i = 0; i < nsets; i++) {
HttpBodySetRawData *body_set;
@@ -1576,7 +1575,7 @@ HdrTest::test_arena()
Arena *arena;
int failures = 0;
- arena = NEW(new Arena);
+ arena = new Arena;
failures += test_arena_aux(arena, 1);
failures += test_arena_aux(arena, 127);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/hdrs/HdrToken.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/HdrToken.cc b/proxy/hdrs/HdrToken.cc
index dbb15ba..7080a06 100644
--- a/proxy/hdrs/HdrToken.cc
+++ b/proxy/hdrs/HdrToken.cc
@@ -597,7 +597,7 @@ hdrtoken_init()
if (!inited) {
inited = 1;
- hdrtoken_strs_dfa = NEW(new DFA);
+ hdrtoken_strs_dfa = new DFA;
hdrtoken_strs_dfa->compile(_hdrtoken_strs, SIZEOF(_hdrtoken_strs), (REFlags) (RE_CASE_INSENSITIVE));
// all the tokenized hdrtoken strings are placed in a special heap,
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/hdrs/MIME.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 0cbee78..e25b58f 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -610,10 +610,10 @@ mime_init()
init = 0;
hdrtoken_init();
- day_names_dfa = NEW(new DFA);
+ day_names_dfa = new DFA;
day_names_dfa->compile(day_names, SIZEOF(day_names), RE_CASE_INSENSITIVE);
- month_names_dfa = NEW(new DFA);
+ month_names_dfa = new DFA;
month_names_dfa->compile(month_names, SIZEOF(month_names), RE_CASE_INSENSITIVE);
MIME_FIELD_ACCEPT = hdrtoken_string_to_wks("Accept");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/hdrs/test_header.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/test_header.cc b/proxy/hdrs/test_header.cc
index 2c3d7fd..b196355 100644
--- a/proxy/hdrs/test_header.cc
+++ b/proxy/hdrs/test_header.cc
@@ -30,7 +30,6 @@
// #include "Marshal.h"
#include "MIME.h"
#include "Regex.h"
-#include "Resource.h"
#include "URL.h"
#include "HttpCompat.h"
@@ -884,7 +883,7 @@ test_arena()
char *str;
int failures = 0;
- arena = NEW(new Arena);
+ arena = new Arena;
failures += test_arena_aux(arena, 1);
failures += test_arena_aux(arena, 127);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/hdrs/test_urlhash.cc
----------------------------------------------------------------------
diff --git a/proxy/hdrs/test_urlhash.cc b/proxy/hdrs/test_urlhash.cc
index adc78c1..9456563 100644
--- a/proxy/hdrs/test_urlhash.cc
+++ b/proxy/hdrs/test_urlhash.cc
@@ -30,7 +30,6 @@
#include "HTTP.h"
#include "MIME.h"
#include "Regex.h"
-#include "Resource.h"
#include "URL.h"
#include "HttpCompat.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpBodyFactory.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc
index 0650b48..ee248a7 100644
--- a/proxy/http/HttpBodyFactory.cc
+++ b/proxy/http/HttpBodyFactory.cc
@@ -613,7 +613,7 @@ HttpBodyFactory::load_sets_from_directory(char *set_dir)
return (NULL);
}
- new_table_of_sets = NEW(new RawHashTable(RawHashTable_KeyType_String));
+ new_table_of_sets = new RawHashTable(RawHashTable_KeyType_String);
entry_buffer = (struct dirent *)ats_malloc(sizeof(struct dirent) + MAXPATHLEN + 1);
//////////////////////////////////////////
@@ -691,7 +691,7 @@ HttpBodyFactory::load_body_set_from_directory(char *set_name, char *tmpl_dir)
// create body set, and loop over template files, loading them //
/////////////////////////////////////////////////////////////////
- HttpBodySet *body_set = NEW(new HttpBodySet);
+ HttpBodySet *body_set = new HttpBodySet;
body_set->init(set_name, tmpl_dir);
Debug("body_factory", " body_set = %p (set_name '%s', lang '%s', charset '%s')",
@@ -719,7 +719,7 @@ HttpBodyFactory::load_body_set_from_directory(char *set_name, char *tmpl_dir)
// read in this template file //
////////////////////////////////
- tmpl = NEW(new HttpBodyTemplate());
+ tmpl = new HttpBodyTemplate();
if (!tmpl->load_from_file(tmpl_dir, entry_buffer->d_name)) {
delete tmpl;
} else {
@@ -778,7 +778,7 @@ HttpBodySet::init(char *set, char *dir)
if (this->table_of_pages)
delete(this->table_of_pages);
- this->table_of_pages = NEW(new RawHashTable(RawHashTable_KeyType_String));
+ this->table_of_pages = new RawHashTable(RawHashTable_KeyType_String);
lineno = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 535a1be..0d9c9e3 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1216,7 +1216,7 @@ HttpConfig::startup()
HttpConfigParams &c = m_master;
- http_config_cont = NEW(new HttpConfigCont);
+ http_config_cont = new HttpConfigCont;
HttpEstablishStaticConfigStringAlloc(c.proxy_hostname, "proxy.config.proxy_name");
c.proxy_hostname_len = -1;
@@ -1479,7 +1479,7 @@ HttpConfig::reconfigure()
HttpConfigParams *params;
- params = NEW(new HttpConfigParams);
+ params = new HttpConfigParams;
params->inbound_ip4 = m_master.inbound_ip4;
params->inbound_ip6 = m_master.inbound_ip6;
@@ -1746,7 +1746,7 @@ HttpConfig::parse_ports_list(char *ports_string)
return (0);
if (strchr(ports_string, '*')) {
- ports_list = NEW(new HttpConfigPortRange);
+ ports_list = new HttpConfigPortRange;
ports_list->low = -1;
ports_list->high = -1;
ports_list->next = NULL;
@@ -1773,7 +1773,7 @@ HttpConfig::parse_ports_list(char *ports_string)
if (start == end)
break;
- pr = NEW(new HttpConfigPortRange);
+ pr = new HttpConfigPortRange;
pr->low = atoi(start);
pr->high = pr->low;
pr->next = NULL;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpPages.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpPages.cc b/proxy/http/HttpPages.cc
index ad4f65e..def7661 100644
--- a/proxy/http/HttpPages.cc
+++ b/proxy/http/HttpPages.cc
@@ -461,7 +461,7 @@ http_pages_callback(Continuation * cont, HTTPHdr * header)
{
HttpPagesHandler *handler;
- handler = NEW(new HttpPagesHandler(cont, header));
+ handler = new HttpPagesHandler(cont, header);
eventProcessor.schedule_imm(handler, ET_CALL);
return &handler->action;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpProxyServerMain.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc
index f5a64df..2bf7d64 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -170,22 +170,23 @@ MakeHttpProxyAcceptor(HttpProxyAcceptor& acceptor, HttpProxyPort& port, unsigned
// XXX the protocol probe should be a configuration option.
- ProtocolProbeSessionAccept *probe = NEW(new ProtocolProbeSessionAccept());
+ ProtocolProbeSessionAccept *probe = new ProtocolProbeSessionAccept();
HttpSessionAccept *http = 0; // don't allocate this unless it will be used.
if (port.m_session_protocol_preference.intersects(HTTP_PROTOCOL_SET)) {
- http = NEW(new HttpSessionAccept(accept_opt));
+ http = new HttpSessionAccept(accept_opt);
probe->registerEndpoint(ProtocolProbeSessionAccept::PROTO_HTTP, http);
}
#if TS_HAS_SPDY
if (port.m_session_protocol_preference.intersects(SPDY_PROTOCOL_SET)) {
- probe->registerEndpoint(ProtocolProbeSessionAccept::PROTO_SPDY, NEW(new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3_1)));
+ probe->registerEndpoint(ProtocolProbeSessionAccept::PROTO_SPDY,
+ new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3_1));
}
#endif
if (port.isSSL()) {
- SSLNextProtocolAccept *ssl = NEW(new SSLNextProtocolAccept(probe));
+ SSLNextProtocolAccept *ssl = new SSLNextProtocolAccept(probe);
// ALPN selects the first server-offered protocol,
// so make sure that we offer the newest protocol first.
@@ -206,11 +207,11 @@ MakeHttpProxyAcceptor(HttpProxyAcceptor& acceptor, HttpProxyPort& port, unsigned
// SPDY
#if TS_HAS_SPDY
if (port.m_session_protocol_preference.contains(TS_NPN_PROTOCOL_INDEX_SPDY_3)) {
- ssl->registerEndpoint(TS_NPN_PROTOCOL_SPDY_3, NEW(new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3)));
+ ssl->registerEndpoint(TS_NPN_PROTOCOL_SPDY_3, new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3));
}
if (port.m_session_protocol_preference.contains(TS_NPN_PROTOCOL_INDEX_SPDY_3_1)) {
- ssl->registerEndpoint(TS_NPN_PROTOCOL_SPDY_3_1, NEW(new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3_1)));
+ ssl->registerEndpoint(TS_NPN_PROTOCOL_SPDY_3_1, new SpdySessionAccept(SpdySessionAccept::SPDY_VERSION_3_1));
}
#endif
@@ -243,14 +244,14 @@ init_HttpProxyServer(int n_accept_threads)
// port but without going through the operating system
//
if (plugin_http_accept == NULL) {
- plugin_http_accept = NEW(new HttpSessionAccept);
+ plugin_http_accept = new HttpSessionAccept;
plugin_http_accept->mutex = new_ProxyMutex();
}
// Same as plugin_http_accept except outbound transparent.
if (! plugin_http_transparent_accept) {
HttpSessionAccept::Options ha_opt;
ha_opt.setOutboundTransparent(true);
- plugin_http_transparent_accept = NEW(new HttpSessionAccept(ha_opt));
+ plugin_http_transparent_accept = new HttpSessionAccept(ha_opt);
plugin_http_transparent_accept->mutex = new_ProxyMutex();
}
ink_mutex_init(&ssl_plugin_mutex, "SSL Acceptor List");
@@ -317,5 +318,5 @@ start_HttpProxyServerBackDoor(int port, int accept_threads)
opt.backdoor = true;
// The backdoor only binds the loopback interface
- netProcessor.main_accept(NEW(new HttpSessionAccept(ha_opt)), NO_FD, opt);
+ netProcessor.main_accept(new HttpSessionAccept(ha_opt), NO_FD, opt);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 13fe6a9..2eabc1d 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4052,7 +4052,7 @@ HttpSM::parse_range_and_compare(MIMEField *field, int64_t content_length)
if (n_values <= 0 || ptr_len_ncmp(value, value_len, "bytes=", 6))
return;
- ranges = NEW(new RangeRecord[n_values]);
+ ranges = new RangeRecord[n_values];
value += 6; // skip leading 'bytes='
value_len -= 6;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpSM.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 56b5077..2b5a6fd 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -615,7 +615,7 @@ inline void
HttpSM::add_cache_sm()
{
if (second_cache_sm == NULL) {
- second_cache_sm = NEW(new HttpCacheSM);
+ second_cache_sm = new HttpCacheSM;
second_cache_sm->init(this, mutex);
second_cache_sm->set_lookup_url(cache_sm.get_lookup_url());
if (t_state.cache_info.object_read != NULL) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpSessionManager.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc
index ed1df7f..8f68f79 100644
--- a/proxy/http/HttpSessionManager.cc
+++ b/proxy/http/HttpSessionManager.cc
@@ -43,7 +43,7 @@
void
initialize_thread_for_http_sessions(EThread *thread, int /* thread_index ATS_UNUSED */)
{
- thread->l1_hash = NEW(new SessionBucket[HSM_LEVEL1_BUCKETS]);
+ thread->l1_hash = new SessionBucket[HSM_LEVEL1_BUCKETS];
for (int i = 0; i < HSM_LEVEL1_BUCKETS; ++i)
thread->l1_hash[i].mutex = new_ProxyMutex();
//thread->l1_hash[i].mutex = thread->mutex;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/HttpUpdateTester.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpUpdateTester.cc b/proxy/http/HttpUpdateTester.cc
index 5cc8c28..50f3e5b 100644
--- a/proxy/http/HttpUpdateTester.cc
+++ b/proxy/http/HttpUpdateTester.cc
@@ -121,6 +121,6 @@ init_http_update_test()
return;
}
- UpTest *u = NEW(new UpTest(f, new_ProxyMutex()));
+ UpTest *u = new UpTest(f, new_ProxyMutex());
eventProcessor.schedule_imm(u);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/remap/RemapConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index 90d8de3..0961da6 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -358,7 +358,7 @@ remap_validate_filter_args(acl_filter_rule ** rule_pp, const char ** argv, int a
}
if ((rule = *rule_pp) == NULL) {
- rule = NEW(new acl_filter_rule());
+ rule = new acl_filter_rule();
if (unlikely((*rule_pp = rule) == NULL)) {
Debug("url_rewrite", "[validate_filter_args] Memory allocation error");
return (const char *) "Memory allocation Error";
@@ -656,7 +656,7 @@ remap_load_plugin(const char ** argv, int argc, url_mapping *mp, char *errbuf, i
Debug("remap_plugin", "using path %s for plugin", c);
if (!remap_pi_list || (pi = remap_pi_list->find_by_path(c)) == 0) {
- pi = NEW(new remap_plugin_info(c));
+ pi = new remap_plugin_info(c);
if (!remap_pi_list) {
remap_pi_list = pi;
} else {
@@ -1015,7 +1015,7 @@ remap_parse_config_bti(const char * path, BUILD_TABLE_INFO * bti)
goto MAP_ERROR;
}
- new_mapping = NEW(new url_mapping(cln)); // use line # for rank for now
+ new_mapping = new url_mapping(cln); // use line # for rank for now
// apply filter rules if we have to
if ((errStr = process_filter_opt(new_mapping, bti, errStrBuf, sizeof(errStrBuf))) != NULL) {
@@ -1113,8 +1113,8 @@ remap_parse_config_bti(const char * path, BUILD_TABLE_INFO * bti)
char refinfo_error_buf[1024];
bool refinfo_error = false;
- ri = NEW(new referer_info((char *) bti->paramv[j - 1], &refinfo_error, refinfo_error_buf,
- sizeof(refinfo_error_buf)));
+ ri = new referer_info((char *)bti->paramv[j - 1], &refinfo_error, refinfo_error_buf,
+ sizeof(refinfo_error_buf));
if (refinfo_error) {
snprintf(errBuf, sizeof(errBuf), "%s Incorrect Referer regular expression \"%s\" at line %d - %s",
modulePrefix, bti->paramv[j - 1], cln + 1, refinfo_error_buf);
@@ -1188,7 +1188,7 @@ remap_parse_config_bti(const char * path, BUILD_TABLE_INFO * bti)
reg_map = NULL;
if (is_cur_mapping_regex) {
- reg_map = NEW(new UrlRewrite::RegexMapping());
+ reg_map = new UrlRewrite::RegexMapping();
if (!process_regex_mapping_config(fromHost_lower, new_mapping, reg_map)) {
errStr = "Could not process regex mapping config line";
goto MAP_ERROR;
@@ -1214,7 +1214,7 @@ remap_parse_config_bti(const char * path, BUILD_TABLE_INFO * bti)
url_mapping *u_mapping;
ats_ip_ntop(ai_spot->ai_addr, ipb, sizeof ipb);
- u_mapping = NEW(new url_mapping);
+ u_mapping = new url_mapping;
u_mapping->fromURL.create(NULL);
u_mapping->fromURL.copy(&new_mapping->fromURL);
u_mapping->fromURL.host_set(ipb, strlen(ipb));
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7353f669/proxy/http/remap/UrlMapping.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlMapping.cc b/proxy/http/remap/UrlMapping.cc
index 58739c1..5041e64 100644
--- a/proxy/http/remap/UrlMapping.cc
+++ b/proxy/http/remap/UrlMapping.cc
@@ -157,7 +157,7 @@ redirect_tag_str::parse_format_redirect_url(char *url)
}
}
}
- r = NEW(new redirect_tag_str());
+ r = new redirect_tag_str();
if (likely(r)) {
if ((r->type = type) == 's') {
char svd = *c;