diff --git a/src/ca/netiiu.cpp b/src/ca/netiiu.cpp index 84e30a81c..767f68f07 100644 --- a/src/ca/netiiu.cpp +++ b/src/ca/netiiu.cpp @@ -47,7 +47,12 @@ void netiiu::show ( unsigned level ) const void netiiu::uninstallAllChan ( tsDLList < nciu > & dstList ) { while ( nciu *pChan = this->channelList.get () ) { - this->clearChannelRequest ( *pChan ); + // if the claim reply has not returned yet then we will issue + // the clear chhannel request to the server when the claim reply + // arrives and there is no matching nciu in the client + if ( pChan->connected() ) { + this->clearChannelRequest ( pChan->getSID(), pChan->getCID() ); + } dstList.add ( *pChan ); } } @@ -128,7 +133,7 @@ void netiiu::createChannelRequest ( nciu & ) { } -void netiiu::clearChannelRequest ( nciu & ) +void netiiu::clearChannelRequest ( ca_uint32_t sid, ca_uint32_t cid ) { } @@ -136,7 +141,7 @@ void netiiu::subscriptionRequest ( nciu &, netSubscription & ) { } -void netiiu::subscriptionCancelRequest ( nciu &, netSubscription & ) +void netiiu::subscriptionCancelRequest ( nciu & chan, netSubscription & subscr ) { } diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index fabde268c..380373b8c 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -1192,18 +1192,16 @@ void tcpiiu::createChannelRequest ( nciu &chan ) this->sendQue.commitMsg (); } -void tcpiiu::clearChannelRequest ( nciu &chan ) +void tcpiiu::clearChannelRequest ( ca_uint32_t sid, ca_uint32_t cid ) { - if ( chan.connected () ) { - this->sendQue.beginMsg (); - this->sendQue.pushUInt16 ( CA_PROTO_CLEAR_CHANNEL ); // cmd - this->sendQue.pushUInt16 ( 0u ); // postsize - this->sendQue.pushUInt16 ( 0u ); // dataType - this->sendQue.pushUInt16 ( 0u ); // count - this->sendQue.pushUInt32 ( chan.getSID () ); // cid - this->sendQue.pushUInt32 ( chan.getCID () ); // available - this->sendQue.commitMsg (); - } + this->sendQue.beginMsg (); + this->sendQue.pushUInt16 ( CA_PROTO_CLEAR_CHANNEL ); // cmd + this->sendQue.pushUInt16 ( 0u ); // postsize + this->sendQue.pushUInt16 ( 0u ); // dataType + this->sendQue.pushUInt16 ( 0u ); // count + this->sendQue.pushUInt32 ( sid ); // cid + this->sendQue.pushUInt32 ( cid ); // available + this->sendQue.commitMsg (); } // @@ -1248,12 +1246,12 @@ void tcpiiu::subscriptionRequest ( nciu &chan, netSubscription & subscr ) this->sendQue.commitMsg (); } -void tcpiiu::subscriptionCancelRequest ( nciu &chan, netSubscription &subscr ) +void tcpiiu::subscriptionCancelRequest ( nciu & chan, netSubscription & subscr ) { insertRequestHeader ( this->sendQue, CA_PROTO_EVENT_CANCEL, 0u, - static_cast < ca_uint16_t > ( subscr.getType () ), - static_cast < ca_uint16_t > ( subscr.getCount () ), + static_cast < ca_uint16_t > ( subscr.getType() ), + static_cast < ca_uint16_t > ( subscr.getCount() ), chan.getSID(), subscr.getID(), CA_V49 ( this->minorProtocolVersion ) ); this->sendQue.commitMsg ();