Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCI_SubscriptionRegister possible bug using port #136

Closed
luk65 opened this issue Jan 16, 2018 · 2 comments
Closed

OCI_SubscriptionRegister possible bug using port #136

luk65 opened this issue Jan 16, 2018 · 2 comments
Assignees

Comments

@luk65
Copy link

luk65 commented Jan 16, 2018

Hello all,
I tested the notification.c demo program where the notification port is set to 5468 but instead the program assigns a random port while running.

I made some changes to the OCI_SubscriptionRegister source code in the subscriptions.c file as follows:

**** LINE 181:

        if (sub->port > 0)
        {

#if 0 /* Port must be set on sub->env /
OCI_SET_ATTRIB(OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_PORTNO, sub->subhp, &sub->port, sizeof(sub->port))
#else
OCI_SET_ATTRIB(OCI_HTYPE_ENV, OCI_ATTR_SUBSCR_PORTNO, sub->env, &sub->port, sizeof(sub->port))
#endif
}
#if 0 /
The 'else' branch is useless here, since no registration has been make yet */
else
{
OCI_GET_ATTRIB(OCI_HTYPE_SUBSCRIPTION, OCI_ATTR_SUBSCR_PORTNO, sub->subhp, &sub->port,NULL)
}
#endif

...

        /* all attributes set, let's register the subscription ! */

        OCI_EXEC(OCISubscriptionRegister(sub->con->cxt, &sub->subhp, (ub2) 1, sub->err,(ub4) OCI_DEFAULT))

**** LINE 252:
#if 1 /* Registration has been made, so we can retrieve the actual port returned by O.S. */
if (sub -> port == 0)
{
OCI_GET_ATTRIB(OCI_HTYPE_ENV, OCI_ATTR_SUBSCR_PORTNO, sub->env, &sub->port,NULL)
}
#endif

Regards,
Luciano

@vrogier
Copy link
Owner

vrogier commented Jan 16, 2018

Hi,

Thanks for reporting it :)

I will look at it this evening.

Best regards,

Vincent

@vrogier
Copy link
Owner

vrogier commented Jan 16, 2018

Fix committed !
Thanks for you input :)

Best regards,

Vincent

@vrogier vrogier self-assigned this Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants