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

pg_listen not passing payload to notifier #42

Merged
merged 3 commits into from
Feb 9, 2022
Merged

Conversation

resuna
Copy link
Member

@resuna resuna commented Feb 4, 2022

This should fix #23

Comment on lines 1208 to 1217
if (event->notify) {
Tcl_ListObjAppendElement(NULL, callbackList, Tcl_NewStringObj(event->notify->relname, -1));
Tcl_ListObjAppendElement(NULL, callbackList, Tcl_NewIntObj(event->notify->be_pid));
/* In case there is a payload, add it to the callback as a
* further element to the list.
*/
if (event->notify->extra[0]) {
Tcl_ListObjAppendElement (NULL, callbackList, Tcl_NewStringObj(event->notify->extra, -1));
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If event->notify is NULL, should the callback list be truncated or should it get called with two empty elements?

@bovine
Copy link
Member

bovine commented Feb 7, 2022

requesting review by @holgerjakobs and @rianby64

In particular I would like some feedback on how the callback list should be constructed in the case of a missing notify element.

@resuna resuna merged commit b2c40ed into master Feb 9, 2022
@bovine bovine deleted the pg_listen_payload branch February 9, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pg_listen is not working properly
2 participants