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

lua: fix lua registration callback for more then one lua script #3139

Closed
wants to merge 1 commit into from
Closed

lua: fix lua registration callback for more then one lua script #3139

wants to merge 1 commit into from

Conversation

feckert
Copy link
Contributor

@feckert feckert commented Apr 12, 2019

This is already applied to NetBSD:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/collectd/patches/patch-src_lua.c?annotate=1.1

Closes #2379

Changelog: lua: fix lua registration callback for more then one lua script

Until now it was not possible to register more than one lua script.
With this change it is now possible.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
@feckert feckert changed the title lua: change so that more than one lua script can be registered lua: fix lua registration callback for more then one lua script Apr 13, 2019
@feckert
Copy link
Contributor Author

feckert commented Apr 24, 2019

@octo ping

@rpv-tomsk rpv-tomsk added the Bug A genuine bug label May 1, 2019
@rpv-tomsk rpv-tomsk added this to the 5.9 milestone May 1, 2019
rpv-tomsk added a commit to rpv-tomsk/collectd that referenced this pull request May 1, 2019
lua_tostring(), used to identify readers/writers, doesn't work
on functions (it returns NULL). So, callback name is not unique and
its registration fail.

Added code to store script path and callback index in LUA Registry and
to build callback name based on them.

Added possibility to pass LUA callback as global-scope function name.
In this case callback name is built using function name, not callback
index.

Closes: collectd#2379
Closes: collectd#3139
@rubenk rubenk closed this in #3144 May 2, 2019
@feckert feckert deleted the pr/20190412-lua-callback-fix branch May 2, 2019 10:25
@octo octo added Fix A pull request fixing a bug and removed Bug A genuine bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix A pull request fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants