diff options
-rw-r--r-- | TAO/ChangeLog | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event_Utilities.cpp | 30 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event_Utilities.h | 5 |
3 files changed, 27 insertions, 14 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 0e3e0024356..4949d904f84 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,9 @@ +Wed Aug 25 13:25:41 UTC 2010 Martin Corino <mcorino@remedy.nl> + + * orbsvcs/orbsvcs/Event_Utilities.h: + * orbsvcs/orbsvcs/Event_Utilities.cpp: + Selected changes from patches in Bugzilla 3652. + Tue Aug 24 14:26:36 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> * interop-tests/wchar/client.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp index 0c44bea3fd1..a0ecca3713b 100644 --- a/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp @@ -16,11 +16,19 @@ ACE_RCSID (orbsvcs, TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ConsumerQOS_Factory:: - ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer) + ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer, + CORBA::ULong qos_max_len) : designator_set_ (0), event_initializer_ (initializer) { qos_.is_gateway = 0; + + // Allocate the space requested by the application.... + qos_.dependencies.length (qos_max_len); + + // ... now reset the length, we do not want to use any elements in + // the sequence that have not been initialized.... + qos_.dependencies.length (0); } ACE_ConsumerQOS_Factory::~ACE_ConsumerQOS_Factory (void) @@ -157,7 +165,7 @@ ACE_ConsumerQOS_Factory::debug (const RtecEventChannelAdmin::ConsumerQOS& qos) // ************************************************************ ACE_SupplierQOS_Factory:: ACE_SupplierQOS_Factory (TAO_EC_Event_Initializer initializer, - int qos_max_len) + CORBA::ULong qos_max_len) : event_initializer_ (initializer) { qos_.is_gateway = 0; @@ -177,16 +185,14 @@ ACE_SupplierQOS_Factory::insert (RtecEventComm::EventSourceID sid, u_int ncalls) { CORBA::ULong l = this->qos_.publications.length (); - if (l >= this->qos_.publications.maximum ()) - { - // There is not enough space for the next element, grow the - // buffer. - this->qos_.publications.length (l + 1); - - // @@ TODO We may want to consider more efficient growing - // strategies here, for example, duplicating the size of the - // buffer, or growing in fixed sized chunks... - } + + // @@ TODO We may want to consider more efficient growing + // strategies here, for example, duplicating the size of the + // buffer, or growing in fixed sized chunks... + + // This needs to accurately reflect the used length, and should always be + // set + this->qos_.publications.length (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.publications[l].event); diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.h b/TAO/orbsvcs/orbsvcs/Event_Utilities.h index 07b0305eb63..80dcde4ad2d 100644 --- a/TAO/orbsvcs/orbsvcs/Event_Utilities.h +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.h @@ -96,7 +96,8 @@ class TAO_RTEvent_Export ACE_ConsumerQOS_Factory { public: /// Default construction. - ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer = 0); + ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer = 0, + CORBA::ULong qos_max_len = 0); /// Death and destruction. ~ACE_ConsumerQOS_Factory (void); @@ -211,7 +212,7 @@ class TAO_RTEvent_Export ACE_SupplierQOS_Factory public: /// Default construction. ACE_SupplierQOS_Factory (TAO_EC_Event_Initializer initializer = 0, - int qos_max_len = 0); + CORBA::ULong qos_max_len = 0); /** * Publish @a sid and @a type that is generate by a method described by |