-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/soap: Refactor userland function calling code #19055
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
base: master
Are you sure you want to change the base?
Conversation
ext/soap/soap.c
Outdated
zend_function *header_fn = zend_hash_find_ptr_lc(function_table, Z_STR(h->function_name)); | ||
if (UNEXPECTED(header_fn == NULL)) { | ||
if (soap_obj_ce && soap_obj_ce->__call) { | ||
header_fn = zend_get_call_trampoline_func(soap_obj_ce, Z_STR(function_name), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using zend_get_call_trampoline_func
you should also release the trampoline function when you're done with it. This usually doesn't cause problems because as long as you're outside of a trampoline call, this function will store the trampoline in EG(trampoline)
. It should be possible to test this by making a soap call from within a trampoline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must be honest that I'm not exactly certain how to write a test for SOAP, do I need to "call" the trampoline from the XML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll instantiate a SoapServer class and use setObject
with a class that has a __call
implementation.
The SoapServer::handle() function should be called from within another class's __call
implementation.
That way, there are 2 trampolines active, and so the one invoked in this C code will use a heap-allocated function structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'm starting to wonder whether the manual trampoline handling will make the code more complex than it already was
Commits should be reviewed in order.
This gets rid of some more
call_user_function
API calls and reduces the amount of string copying.