Skip to content

Commit

Permalink
Ensure that the correct mode is used then a subscription is unregiste…
Browse files Browse the repository at this point in the history
…red.
  • Loading branch information
anthony-tuininga committed Nov 21, 2019
1 parent b57f08d commit ad75cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dpiImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ struct dpiSubscr {
dpiSubscrQOS qos; // quality of service flags
dpiSubscrCallback callback; // callback when event is propagated
void *callbackContext; // context pointer for callback
int clientInitiated; // client initiated?
int registered; // registered with database?
};

Expand Down
5 changes: 4 additions & 1 deletion src/dpiOci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3523,13 +3523,16 @@ int dpiOci__subscriptionRegister(dpiConn *conn, void **handle, uint32_t mode,
int dpiOci__subscriptionUnRegister(dpiConn *conn, dpiSubscr *subscr,
dpiError *error)
{
uint32_t mode;
int status;

DPI_OCI_LOAD_SYMBOL("OCISubscriptionUnRegister",
dpiOciSymbols.fnSubscriptionUnRegister)
DPI_OCI_ENSURE_ERROR_HANDLE(error)
mode = (subscr->clientInitiated) ? DPI_OCI_SECURE_NOTIFICATION :
DPI_OCI_DEFAULT;
status = (*dpiOciSymbols.fnSubscriptionUnRegister)(conn->handle,
subscr->handle, error->handle, DPI_OCI_DEFAULT);
subscr->handle, error->handle, mode);
DPI_OCI_CHECK_AND_RETURN(error, status, conn, "unregister");
}

Expand Down
1 change: 1 addition & 0 deletions src/dpiSubscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ int dpiSubscr__create(dpiSubscr *subscr, dpiConn *conn,
subscr->callbackContext = params->callbackContext;
subscr->subscrNamespace = params->subscrNamespace;
subscr->qos = params->qos;
subscr->clientInitiated = params->clientInitiated;
dpiMutex__initialize(subscr->mutex);

// create the subscription handle
Expand Down

0 comments on commit ad75cae

Please sign in to comment.