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 2015/06/19 01:02:10 UTC
[2/2] trafficserver git commit: TS-3589 clang-format
TS-3589 clang-format
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/83d9826d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/83d9826d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/83d9826d
Branch: refs/heads/master
Commit: 83d9826d800ef3d8f1c33b974070179a930d46bc
Parents: 692d576
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jun 18 17:01:57 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jun 18 17:01:57 2015 -0600
----------------------------------------------------------------------
plugins/header_rewrite/conditions.cc | 14 +++++++-------
plugins/header_rewrite/conditions.h | 12 +++++-------
2 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/83d9826d/plugins/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc
index c2ea4fc..0264d9e 100644
--- a/plugins/header_rewrite/conditions.cc
+++ b/plugins/header_rewrite/conditions.cc
@@ -617,25 +617,25 @@ ConditionIncomingPort::append_value(std::string &s, const Resources &res)
// ConditionTransactCount
void
-ConditionTransactCount::initialize(Parser& p)
+ConditionTransactCount::initialize(Parser &p)
{
Condition::initialize(p);
- MatcherType* match = new MatcherType(_cond_op);
- std::string const& arg = p.get_arg();
+ MatcherType *match = new MatcherType(_cond_op);
+ std::string const &arg = p.get_arg();
match->set(strtol(arg.c_str(), NULL, 10));
_matcher = match;
}
bool
-ConditionTransactCount::eval(const Resources& res)
+ConditionTransactCount::eval(const Resources &res)
{
TSHttpSsn ssn = TSHttpTxnSsnGet(res.txnp);
bool rval = false;
if (ssn) {
int n = TSHttpSsnTransactionCount(ssn);
- rval = static_cast<MatcherType*>(_matcher)->test(n);
+ rval = static_cast<MatcherType *>(_matcher)->test(n);
TSDebug(PLUGIN_NAME, "Evaluating TXN-COUNT(): %d: rval: %s", n, rval ? "true" : "false");
} else {
TSDebug(PLUGIN_NAME, "Evaluation TXN-COUNT(): No session found, returning false");
@@ -644,10 +644,10 @@ ConditionTransactCount::eval(const Resources& res)
}
void
-ConditionTransactCount::append_value(std::string& s, Resources const& res)
+ConditionTransactCount::append_value(std::string &s, Resources const &res)
{
TSHttpSsn ssn = TSHttpTxnSsnGet(res.txnp);
-
+
if (ssn) {
char value[32]; // enough for UINT64_MAX
int count = TSHttpSsnTransactionCount(ssn);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/83d9826d/plugins/header_rewrite/conditions.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.h b/plugins/header_rewrite/conditions.h
index 7447ead..c905da5 100644
--- a/plugins/header_rewrite/conditions.h
+++ b/plugins/header_rewrite/conditions.h
@@ -374,17 +374,15 @@ private:
DISALLOW_COPY_AND_ASSIGN(ConditionIncomingPort);
};
-//Transact Count
+// Transact Count
class ConditionTransactCount : public Condition
{
typedef Matchers<int> MatcherType;
- public:
- ConditionTransactCount()
- {
- TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionTransactCount");
- }
- void initialize(Parser& p);
+public:
+ ConditionTransactCount() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionTransactCount"); }
+
+ void initialize(Parser &p);
void append_value(std::string &s, const Resources &res);
protected: