-
Notifications
You must be signed in to change notification settings - Fork 7.9k
streams: Various minor refactorings #19106
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
Conversation
The flags variable is passed to the filter virtual function that requires an int
@@ -35,9 +35,9 @@ | |||
/* {{{ resource and registration code */ | |||
/* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */ | |||
static HashTable url_stream_wrappers_hash; | |||
static int le_stream = FAILURE; /* true global */ |
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.
Well, not checked by first party engine code, but sure
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.
Do you think this should just be removed then?
@@ -760,21 +750,21 @@ PHP_FUNCTION(stream_select) | |||
FD_ZERO(&efds); | |||
|
|||
if (r_array != NULL) { | |||
set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd); |
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.
One could wonder why the ZPP doesn't use Z_PARAM_ARRAY_HT_EX2
in the first place
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 think because the parameter is a reference that is also written to, and so you need it to be a zval?
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.
It is a ref that is written to, but that doesn't mean it needs to be a zval?
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 frankly never understand how PHP references are meant to work, and how to deal with them in functions.
Will try and see if I can just use Z_PARAM_ARRAY_HT_EX2
directly :)
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 really don't see how to handle the zval* being destroyed and reassigned to when using the HT directly, so I'll leave this for someone else to figure out.
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.
As far as pgsql/socket go, lgtm but I like php_stream_cast return type better in this anyway.
The result of the functions returning those globals is never checked anyway
This only ever returned SUCCESS
Rather than casting to zend_long
cce84e7
to
0db4f60
Compare
Commits should be reviewed in order as they are meant to be independant.