-
Notifications
You must be signed in to change notification settings - Fork 7.8k
main/network: Use more appropriate types #15511
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
Because WinSock does not define
Lines 124 to 158 in 0775b99
So we use our own stuff, whenever
Likely a good idea. Note though that our network implementation is a danger zone. @devnexen may have more insights about this. |
I agree with this statement, every unix supported by php implements poll, including Haiku (I double checked, it is implemented fully kernel wise and all). |
And check directly against 0 for success for functions not returning a zend_result
Not sure why it even is here
c41d1ea
to
8a9c845
Compare
I split the two discussion points into their own issues so that it is not forgotten. :) |
And check directly against 0 for success for functions not returning a
zend_result
.While going through the file, I noticed a few things:
Signed
socklen_t
on WindowsI don't really understand why
socklen_t
is a signed integer on Windows rather than unsigned.php-src/main/php.h
Lines 192 to 198 in 69d9c12
poll(2)
emulationWe define our own
poll
function whenPHP_USE_POLL_2_EMULATION
is set, but I can't seem to find when it is set, is this related to Windows @cmb69 ?Usage of
gethostbyname_r()
It seems like this function is obsolete and
according to https://man7.org/linux/man-pages/man3/gethostbyname.3.html
So maybe we should review this code to use more modern functions?
It seems getting rid of them would also allow us to get rid of:
php-src/ext/standard/file.h
Lines 106 to 110 in 69d9c12