You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2014/07/14 22:43:26 UTC
[06/11] git commit: TS-1475: fix clang warning
TS-1475: fix clang warning
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c982ad2f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c982ad2f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c982ad2f
Branch: refs/heads/master
Commit: c982ad2f1a3e154fbe4c5dd05f88e98e0386d7de
Parents: 9586ba4
Author: Phil Sorber <so...@apache.org>
Authored: Mon Jul 14 13:43:09 2014 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Mon Jul 14 14:43:08 2014 -0600
----------------------------------------------------------------------
proxy/PluginVC.cc | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c982ad2f/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index d01a1d4..f31f1c9 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -84,7 +84,6 @@
#define EVENT_PTR_CLOSED (void*) 0x2
#define PVC_TYPE ((vc_type == PLUGIN_VC_ACTIVE) ? "Active" : "Passive")
-#define PVC_ID (core_obj? core_obj->id : (unsigned)-1)
PluginVC::PluginVC(PluginVCCore *core_obj):
NetVConnection(),
@@ -95,6 +94,7 @@ closed(false), sm_lock_retry_event(NULL), core_lock_retry_event(NULL),
deletable(false), reentrancy_count(0), active_timeout(0), active_event(NULL),
inactive_timeout(0), inactive_timeout_at(0), inactive_event(NULL)
{
+ ink_assert(core_obj != NULL);
SET_HANDLER(&PluginVC::main_handler);
}
@@ -107,7 +107,7 @@ int
PluginVC::main_handler(int event, void *data)
{
- Debug("pvc_event", "[%u] %s: Received event %d", PVC_ID, PVC_TYPE, event);
+ Debug("pvc_event", "[%u] %s: Received event %d", core_obj->id, PVC_TYPE, event);
ink_release_assert(event == EVENT_INTERVAL || event == EVENT_IMMEDIATE);
ink_release_assert(magic == PLUGIN_VC_MAGIC_ALIVE);
@@ -252,7 +252,7 @@ PluginVC::do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf)
read_state.vio.vc_server = (VConnection *) this;
read_state.vio.op = VIO::READ;
- Debug("pvc", "[%u] %s: do_io_read for %" PRId64" bytes", PVC_ID, PVC_TYPE, nbytes);
+ Debug("pvc", "[%u] %s: do_io_read for %" PRId64" bytes", core_obj->id, PVC_TYPE, nbytes);
// Since reentrant callbacks are not allowed on from do_io
// functions schedule ourselves get on a different stack
@@ -285,7 +285,7 @@ PluginVC::do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * abuffer
write_state.vio.vc_server = (VConnection *) this;
write_state.vio.op = VIO::WRITE;
- Debug("pvc", "[%u] %s: do_io_write for %" PRId64" bytes", PVC_ID, PVC_TYPE, nbytes);
+ Debug("pvc", "[%u] %s: do_io_write for %" PRId64" bytes", core_obj->id, PVC_TYPE, nbytes);
// Since reentrant callbacks are not allowed on from do_io
// functions schedule ourselves get on a different stack
@@ -303,7 +303,7 @@ PluginVC::reenable(VIO * vio)
ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE);
ink_assert(vio->mutex->thread_holding == this_ethread());
- Debug("pvc", "[%u] %s: reenable %s", PVC_ID, PVC_TYPE, (vio->op == VIO::WRITE) ? "Write" : "Read");
+ Debug("pvc", "[%u] %s: reenable %s", core_obj->id, PVC_TYPE, (vio->op == VIO::WRITE) ? "Write" : "Read");
if (vio->op == VIO::WRITE) {
ink_assert(vio == &write_state.vio);
@@ -324,7 +324,7 @@ PluginVC::reenable_re(VIO * vio)
ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE);
ink_assert(vio->mutex->thread_holding == this_ethread());
- Debug("pvc", "[%u] %s: reenable_re %s", PVC_ID, PVC_TYPE, (vio->op == VIO::WRITE) ? "Write" : "Read");
+ Debug("pvc", "[%u] %s: reenable_re %s", core_obj->id, PVC_TYPE, (vio->op == VIO::WRITE) ? "Write" : "Read");
MUTEX_TRY_LOCK(lock, this->mutex, this_ethread());
if (!lock) {
@@ -365,7 +365,7 @@ PluginVC::do_io_close(int /* flag ATS_UNUSED */)
ink_assert(closed == false);
ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE);
- Debug("pvc", "[%u] %s: do_io_close", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: do_io_close", core_obj->id, PVC_TYPE);
if (reentrancy_count > 0) {
// Do nothing since dealloacting ourselves
@@ -494,14 +494,14 @@ PluginVC::process_write_side(bool other_side_call)
ink_assert(my_ethread != NULL);
MUTEX_TRY_LOCK(lock, write_state.vio.mutex, my_ethread);
if (!lock) {
- Debug("pvc_event", "[%u] %s: process_write_side lock miss, retrying", PVC_ID, PVC_TYPE);
+ Debug("pvc_event", "[%u] %s: process_write_side lock miss, retrying", core_obj->id, PVC_TYPE);
need_write_process = true;
setup_event_cb(PVC_LOCK_RETRY_TIME, &core_lock_retry_event);
return;
}
- Debug("pvc", "[%u] %s: process_write_side", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_write_side", core_obj->id, PVC_TYPE);
need_write_process = false;
@@ -515,7 +515,7 @@ PluginVC::process_write_side(bool other_side_call)
int64_t bytes_avail = reader->read_avail();
int64_t act_on = MIN(bytes_avail, ntodo);
- Debug("pvc", "[%u] %s: process_write_side; act_on %" PRId64"", PVC_ID, PVC_TYPE, act_on);
+ Debug("pvc", "[%u] %s: process_write_side; act_on %" PRId64"", core_obj->id, PVC_TYPE, act_on);
if (other_side->closed || other_side->read_state.shutdown) {
write_state.vio._cont->handleEvent(VC_EVENT_ERROR, &write_state.vio);
@@ -535,7 +535,7 @@ PluginVC::process_write_side(bool other_side_call)
//
int64_t buf_space = PVC_DEFAULT_MAX_BYTES - core_buffer->max_read_avail();
if (buf_space <= 0) {
- Debug("pvc", "[%u] %s: process_write_side no buffer space", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_write_side no buffer space", core_obj->id, PVC_TYPE);
return;
}
act_on = MIN(act_on, buf_space);
@@ -545,13 +545,13 @@ PluginVC::process_write_side(bool other_side_call)
// Couldn't actually get the buffer space. This only
// happens on small transfers with the above
// PVC_DEFAULT_MAX_BYTES factor doesn't apply
- Debug("pvc", "[%u] %s: process_write_side out of buffer space", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_write_side out of buffer space", core_obj->id, PVC_TYPE);
return;
}
write_state.vio.ndone += added;
- Debug("pvc", "[%u] %s: process_write_side; added %" PRId64"", PVC_ID, PVC_TYPE, added);
+ Debug("pvc", "[%u] %s: process_write_side; added %" PRId64"", core_obj->id, PVC_TYPE, added);
if (write_state.vio.ntodo() == 0) {
write_state.vio._cont->handleEvent(VC_EVENT_WRITE_COMPLETE, &write_state.vio);
@@ -611,14 +611,14 @@ PluginVC::process_read_side(bool other_side_call)
ink_assert(my_ethread != NULL);
MUTEX_TRY_LOCK(lock, read_state.vio.mutex, my_ethread);
if (!lock) {
- Debug("pvc_event", "[%u] %s: process_read_side lock miss, retrying", PVC_ID, PVC_TYPE);
+ Debug("pvc_event", "[%u] %s: process_read_side lock miss, retrying", core_obj->id, PVC_TYPE);
need_read_process = true;
setup_event_cb(PVC_LOCK_RETRY_TIME, &core_lock_retry_event);
return;
}
- Debug("pvc", "[%u] %s: process_read_side", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_read_side", core_obj->id, PVC_TYPE);
need_read_process = false;
// Check the state of our read buffer as well as ntodo
@@ -630,7 +630,7 @@ PluginVC::process_read_side(bool other_side_call)
int64_t bytes_avail = core_reader->read_avail();
int64_t act_on = MIN(bytes_avail, ntodo);
- Debug("pvc", "[%u] %s: process_read_side; act_on %" PRId64"", PVC_ID, PVC_TYPE, act_on);
+ Debug("pvc", "[%u] %s: process_read_side; act_on %" PRId64"", core_obj->id, PVC_TYPE, act_on);
if (act_on <= 0) {
if (other_side->closed || other_side->write_state.shutdown) {
@@ -647,7 +647,7 @@ PluginVC::process_read_side(bool other_side_call)
water_mark = MAX(water_mark, PVC_DEFAULT_MAX_BYTES);
int64_t buf_space = water_mark - output_buffer->max_read_avail();
if (buf_space <= 0) {
- Debug("pvc", "[%u] %s: process_read_side no buffer space", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_read_side no buffer space", core_obj->id, PVC_TYPE);
return;
}
act_on = MIN(act_on, buf_space);
@@ -657,13 +657,13 @@ PluginVC::process_read_side(bool other_side_call)
// Couldn't actually get the buffer space. This only
// happens on small transfers with the above
// PVC_DEFAULT_MAX_BYTES factor doesn't apply
- Debug("pvc", "[%u] %s: process_read_side out of buffer space", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_read_side out of buffer space", core_obj->id, PVC_TYPE);
return;
}
read_state.vio.ndone += added;
- Debug("pvc", "[%u] %s: process_read_side; added %" PRId64"", PVC_ID, PVC_TYPE, added);
+ Debug("pvc", "[%u] %s: process_read_side; added %" PRId64"", core_obj->id, PVC_TYPE, added);
if (read_state.vio.ntodo() == 0) {
read_state.vio._cont->handleEvent(VC_EVENT_READ_COMPLETE, &read_state.vio);
@@ -697,7 +697,7 @@ PluginVC::process_close()
ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE);
- Debug("pvc", "[%u] %s: process_close", PVC_ID, PVC_TYPE);
+ Debug("pvc", "[%u] %s: process_close", core_obj->id, PVC_TYPE);
if (!deletable) {
deletable = true;