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 20:10:22 UTC
[07/11] git commit: TS-1475: immediately initalize core_obj PluginVC
constructor
TS-1475: immediately initalize core_obj PluginVC constructor
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b392843e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b392843e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b392843e
Branch: refs/heads/master
Commit: b392843eed5f4286693d3932119fb2a551b68022
Parents: 3b15cc0
Author: Justin Laue <ju...@fp-x.com>
Authored: Mon Jul 14 11:19:56 2014 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Mon Jul 14 12:09:57 2014 -0600
----------------------------------------------------------------------
proxy/PluginVC.cc | 10 +++++-----
proxy/PluginVC.h | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b392843e/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 16eb5a2..d01a1d4 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -46,7 +46,7 @@
sides, in additional this VC's lock. Additionally, issues like
watermarks are very hard to deal with. Since we try to
to move data by IOBufferData references the efficiency penalty shouldn't
- be too bad and if it is a big pentaly, a brave soul can reimplement
+ be too bad and if it is a big penalty, a brave soul can reimplement
to move the data directly without the intermediate buffer.
Locking is difficult issue for this multi-headed beast. In each
@@ -54,7 +54,7 @@
the lock from the state machine using the PluginVC. The read side
lock & the write side lock must be the same. The regular net processor has
this constraint as well. In order to handle scheduling of retry events cleanly,
- we have two event poitners, one for each lock. sm_lock_retry_event can only
+ we have two event pointers, one for each lock. sm_lock_retry_event can only
be changed while holding the using state machine's lock and
core_lock_retry_event can only be manipulated while holding the PluginVC's
lock. On entry to PluginVC::main_handler, we obtain all the locks
@@ -64,7 +64,7 @@
exclusively in the later parts of the handler and we will
be free from do_io or reenable calls on the PluginVC.
- The assumption is made (conistant with IO Core spec) that any close,
+ The assumption is made (consistent with IO Core spec) that any close,
shutdown, reenable, or do_io_{read,write) operation is done by the callee
while holding the lock for that side of the operation.
@@ -86,9 +86,9 @@
#define PVC_TYPE ((vc_type == PLUGIN_VC_ACTIVE) ? "Active" : "Passive")
#define PVC_ID (core_obj? core_obj->id : (unsigned)-1)
-PluginVC::PluginVC():
+PluginVC::PluginVC(PluginVCCore *core_obj):
NetVConnection(),
-magic(PLUGIN_VC_MAGIC_ALIVE), vc_type(PLUGIN_VC_UNKNOWN), core_obj(NULL),
+magic(PLUGIN_VC_MAGIC_ALIVE), vc_type(PLUGIN_VC_UNKNOWN), core_obj(core_obj),
other_side(NULL), read_state(), write_state(),
need_read_process(false), need_write_process(false),
closed(false), sm_lock_retry_event(NULL), core_lock_retry_event(NULL),
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b392843e/proxy/PluginVC.h
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.h b/proxy/PluginVC.h
index 6ee3a93..2389842 100644
--- a/proxy/PluginVC.h
+++ b/proxy/PluginVC.h
@@ -81,7 +81,7 @@ class PluginVC:public NetVConnection, public PluginIdentity
friend class PluginVCCore;
public:
- PluginVC();
+ PluginVC(PluginVCCore *core_obj);
~PluginVC();
virtual VIO *do_io_read(Continuation * c = NULL, int64_t nbytes = INT64_MAX, MIOBuffer * buf = 0);
@@ -249,8 +249,8 @@ private:
inline
PluginVCCore::PluginVCCore():
-active_vc(),
-passive_vc(),
+active_vc(this),
+passive_vc(this),
connect_to(NULL),
connected(false),
p_to_a_buffer(NULL),