Re: Question about adding subscriptions without refresh.


Mark Spielman
 

Thanks Mike. Would you like me to post the fix as a proper patch then? Or would you like to look through the submissions and back track on when this was introduced?

Cheers,
Mark

-----Original Message-----
From: Michael Schonberg [mailto:mikeschonberg@gmail.com] On Behalf Of mschonberg
Sent: Wednesday, July 11, 2012 9:00 PM
To: Mark Spielman
Cc: openmama-dev@lists.openmama.org
Subject: Re: [Openmama-dev] Question about adding subscriptions without refresh.

Mark,

Your fix is correct. The current implementation is clearly wrong. I am not sure when this was introduced, but I suspect it was a recent change. It might be worth looking into.

Regards,
-Mike

On Wed, 11 Jul 2012, Mark Spielman wrote:


In developing a transport bridge for openMAMA, I came across what I
believe is an issue with mama/c_cpp/src/c/transport.c. The
mamaTransport_addSubscription() will return MAMA_STATUS_NOMEM if the
self->mRefreshTransport is not set. This blocked us from successfully
establishing a subscription in the case where a refresh was not desired.

 

I have a patch that I could submit that would change the method to the
following. But before doing so, I’d like to ask if there is anything I
missed? Below is how we updated the code to work.



mama_status
mamaTransport_addSubscription (mamaTransport    transport,
                               mamaSubscription subscription,
                               void**           result) {
    SubscriptionInfo*   handle = NULL;
 
    if (self->mRefreshTransport) {
        handle = refreshTransport_allocateSubscInfo
(self->mRefreshTransport);
 
        if (handle == NULL) return MAMA_STATUS_NOMEM;
 
        handle->mSubscription = subscription;
    }

    *result = handle;

    if (self->mRefreshTransport)
        refreshTransport_addSubscription (self->mRefreshTransport,
handle);

    return MAMA_STATUS_OK;
}

 

Thanks

Mark

 

 

 

 

Mark Spielman

Development Lead, Solace Systems Professional Services
+1-613-271-1010 x1021

mark.spielman@solacesystems.com

www.solacesystems.com

 

 


Join Openmama-dev@lists.openmama.org to automatically receive all group messages.