You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2014/03/12 19:08:11 UTC
git commit: Revert 'atscppapi: Locking fix in xform and utility
macro' This closes #61
Repository: trafficserver
Updated Branches:
refs/heads/master 628dad955 -> 64ff6709f
Revert 'atscppapi: Locking fix in xform and utility macro' This closes #61
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/64ff6709
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/64ff6709
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/64ff6709
Branch: refs/heads/master
Commit: 64ff6709f8baf7769d150bfad98873e52b0594ff
Parents: 628dad9
Author: Brian Geffon <br...@apache.org>
Authored: Wed Mar 12 11:08:02 2014 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Wed Mar 12 11:08:02 2014 -0700
----------------------------------------------------------------------
lib/atscppapi/src/TransformationPlugin.cc | 27 +++++++++--------------
lib/atscppapi/src/include/atscppapi/Logger.h | 11 ---------
2 files changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/64ff6709/lib/atscppapi/src/TransformationPlugin.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/TransformationPlugin.cc b/lib/atscppapi/src/TransformationPlugin.cc
index a3a8691..f859bb3 100644
--- a/lib/atscppapi/src/TransformationPlugin.cc
+++ b/lib/atscppapi/src/TransformationPlugin.cc
@@ -131,8 +131,7 @@ int handleTransformationPluginRead(TSCont contp, TransformationPluginState *stat
/* Now call the client to tell them about data */
if (in_data.length() > 0) {
- ScopedSharedMutexLock scopedLock(state->transformation_plugin_.getMutex());
- state->transformation_plugin_.consume(in_data);
+ state->transformation_plugin_.consume(in_data);
}
}
@@ -155,12 +154,11 @@ int handleTransformationPluginRead(TSCont contp, TransformationPluginState *stat
/* Call back the write VIO continuation to let it know that we have completed the write operation. */
if (!state->input_complete_dispatched_) {
- ScopedSharedMutexLock scopedLock(state->transformation_plugin_.getMutex());
- state->transformation_plugin_.handleInputComplete();
- state->input_complete_dispatched_ = true;
- if (vio_cont) {
- TSContCall(vio_cont, static_cast<TSEvent>(TS_EVENT_VCONN_WRITE_COMPLETE), write_vio);
- }
+ state->transformation_plugin_.handleInputComplete();
+ state->input_complete_dispatched_ = true;
+ if (vio_cont) {
+ TSContCall(vio_cont, static_cast<TSEvent>(TS_EVENT_VCONN_WRITE_COMPLETE), write_vio);
+ }
}
}
} else {
@@ -169,12 +167,11 @@ int handleTransformationPluginRead(TSCont contp, TransformationPluginState *stat
/* Call back the write VIO continuation to let it know that we have completed the write operation. */
if (!state->input_complete_dispatched_) {
- ScopedSharedMutexLock scopedLock(state->transformation_plugin_.getMutex());
- state->transformation_plugin_.handleInputComplete();
- state->input_complete_dispatched_ = true;
- if (vio_cont) {
- TSContCall(vio_cont, static_cast<TSEvent>(TS_EVENT_VCONN_WRITE_COMPLETE), write_vio);
- }
+ state->transformation_plugin_.handleInputComplete();
+ state->input_complete_dispatched_ = true;
+ if (vio_cont) {
+ TSContCall(vio_cont, static_cast<TSEvent>(TS_EVENT_VCONN_WRITE_COMPLETE), write_vio);
+ }
}
}
} else {
@@ -236,7 +233,6 @@ TransformationPlugin::~TransformationPlugin() {
}
size_t TransformationPlugin::produce(const std::string &data) {
- ScopedSharedMutexLock scopedLock(state_->transformation_plugin_.getMutex());
LOG_DEBUG("TransformationPlugin=%p tshttptxn=%p producing output with length=%ld", this, state_->txn_, data.length());
int64_t write_length = static_cast<int64_t>(data.length());
if (!write_length) {
@@ -286,7 +282,6 @@ size_t TransformationPlugin::produce(const std::string &data) {
}
size_t TransformationPlugin::setOutputComplete() {
- ScopedSharedMutexLock scopedLock(state_->transformation_plugin_.getMutex());
int connection_closed = TSVConnClosedGet(state_->vconn_);
LOG_DEBUG("OutputComplete TransformationPlugin=%p tshttptxn=%p vconn=%p connection_closed=%d, total bytes written=%" PRId64, this, state_->txn_, state_->vconn_, connection_closed,state_->bytes_written_);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/64ff6709/lib/atscppapi/src/include/atscppapi/Logger.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/atscppapi/Logger.h b/lib/atscppapi/src/include/atscppapi/Logger.h
index 3227b63..f5227d0 100644
--- a/lib/atscppapi/src/include/atscppapi/Logger.h
+++ b/lib/atscppapi/src/include/atscppapi/Logger.h
@@ -125,17 +125,6 @@ extern "C" void TSError(const char *fmt, ...) ATSCPPAPI_PRINTFLIKE(1,2);
TSError("[%s] [%s:%d, %s()] " fmt, tag, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \
} while (false)
-/**
- * A helper macro for Logger objects that allows you to easily add a error level message
- * which will include file, line, and function name with the message. This macro will also
- * use invoke TS_DEBUG
- */
-#define LOG_ERROR2(log, log_tag, fmt, ...) \
- do { \
- (log).logError("[%s:%d, %s()] " fmt, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \
- TS_DEBUG((log_tag), fmt, ## __VA_ARGS__); \
- } while (false)
-
namespace atscppapi {
struct LoggerState;