From a8abd072824b9f80f2ee9e8a6b151e8448420f68 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Tue, 15 Feb 2011 11:29:36 +0100 Subject: [PATCH] pvRequest == 0 check --- .../remoteClient/clientContextImpl.cpp | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index 87a3e72..bbd4979 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -95,6 +95,7 @@ namespace epics { static Status* destroyedStatus; static Status* channelNotConnected; static Status* otherRequestPendingStatus; + static Status* pvRequestNull; BaseRequestImpl(ChannelImpl* channel, Requester* requester) : m_channel(channel), m_context(channel->getContext()), @@ -284,6 +285,7 @@ namespace epics { Status* BaseRequestImpl::destroyedStatus = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "request destroyed"); Status* BaseRequestImpl::channelNotConnected = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "channel not connected"); Status* BaseRequestImpl::otherRequestPendingStatus = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "other request pending"); + Status* BaseRequestImpl::pvRequestNull = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "pvRequest == 0"); @@ -314,7 +316,7 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelProcess); - // TODO check for 0s!!!! + // pvRequest can be null // TODO best-effort support @@ -433,6 +435,12 @@ namespace epics { m_data(0), m_bitSet(0) { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelGet); + + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_channelGetRequester->channelGetConnect(pvRequestNull, 0, 0, 0)); + return; + } // TODO immediate get, i.e. get data with init message // TODO one-time get, i.e. immediate get + lastRequest @@ -579,6 +587,12 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelPut); + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_channelPutRequester->channelPutConnect(pvRequestNull, 0, 0, 0)); + return; + } + // TODO low-overhead put // TODO best-effort put @@ -751,6 +765,12 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelPutGet); + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_channelPutGetRequester->channelPutGetConnect(pvRequestNull, 0, 0, 0)); + return; + } + // subscribe try { resubscribeSubscription(m_channel->checkAndGetTransport()); @@ -966,6 +986,12 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelRPC); + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_channelRPCRequester->channelRPCConnect(pvRequestNull, 0, 0, 0)); + return; + } + // subscribe try { resubscribeSubscription(m_channel->checkAndGetTransport()); @@ -1114,6 +1140,12 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelArray); + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_channelArrayRequester->channelArrayConnect(pvRequestNull, 0, 0)); + return; + } + // subscribe try { resubscribeSubscription(m_channel->checkAndGetTransport()); @@ -1504,6 +1536,12 @@ namespace epics { { PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelMonitor); + if (pvRequest == 0) + { + EXCEPTION_GUARD(m_monitorRequester->monitorConnect(pvRequestNull, 0, 0)); + return; + } + // TODO quques // subscribe