fix SharedPV allow rpc() while close()'d
Don't call channelRPCConnect() again during open(). Turns out that a second channelRPCConnect() has the effect of sending a reply with OK and NULL.
This commit is contained in:
@@ -124,7 +124,6 @@ struct PutInfo { // oh to be able to use std::tuple ...
|
||||
void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet& valid)
|
||||
{
|
||||
typedef std::vector<PutInfo> xputs_t;
|
||||
typedef std::vector<std::tr1::shared_ptr<SharedRPC> > xrpcs_t;
|
||||
typedef std::vector<std::tr1::shared_ptr<pva::MonitorFIFO> > xmonitors_t;
|
||||
typedef std::vector<std::tr1::shared_ptr<pva::GetFieldRequester> > xgetfields_t;
|
||||
|
||||
@@ -133,7 +132,6 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet&
|
||||
newvalue->copyUnchecked(value, valid);
|
||||
|
||||
xputs_t p_put;
|
||||
xrpcs_t p_rpc;
|
||||
xmonitors_t p_monitor;
|
||||
xgetfields_t p_getfield;
|
||||
{
|
||||
@@ -143,7 +141,6 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet&
|
||||
throw std::logic_error("Already open()");
|
||||
|
||||
p_put.reserve(puts.size());
|
||||
p_rpc.reserve(rpcs.size());
|
||||
p_monitor.reserve(monitors.size());
|
||||
p_getfield.reserve(getfields.size());
|
||||
|
||||
@@ -164,11 +161,6 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet&
|
||||
//racing destruction
|
||||
}
|
||||
}
|
||||
FOR_EACH(rpcs_t::const_iterator, it, end, rpcs) {
|
||||
try {
|
||||
p_rpc.push_back((*it)->shared_from_this());
|
||||
}catch(std::tr1::bad_weak_ptr&) {}
|
||||
}
|
||||
FOR_EACH(monitors_t::const_iterator, it, end, monitors) {
|
||||
try {
|
||||
(*it)->open(newtype);
|
||||
@@ -192,10 +184,6 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet&
|
||||
requester->channelPutConnect(it->status, it->put, it->type);
|
||||
}
|
||||
}
|
||||
FOR_EACH(xrpcs_t::iterator, it, end, p_rpc) {
|
||||
SharedRPC::requester_type::shared_pointer requester((*it)->requester.lock());
|
||||
if(requester) requester->channelRPCConnect(pvd::Status(), *it);
|
||||
}
|
||||
FOR_EACH(xmonitors_t::iterator, it, end, p_monitor) {
|
||||
(*it)->notify();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user