Question about adding subscriptions without refresh.
Mark Spielman
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
|
|
mschonberg <mschonberg@...>
Mark,
toggle quoted messageShow quoted text
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:
|
|
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?
toggle quoted messageShow quoted text
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:
|
|
mschonberg <mschonberg@...>
On Thu, 12 Jul 2012, Mark Spielman wrote:
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?I found the problem. We previously had unnecessary #ifdef's that allowed us to conditionally compile MAMA without any refresh logic. When we removed the conditional compilation, we erroneously deleted the code that maintained the list of subscriptions in the parent transport rather than the "refresh" transport. A patch that restores the correct logic will follow shortly. Regards, -Mike
|
|