main/network: Use more appropriate types#15511
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_ton WindowsI don't really understand why
socklen_tis 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
pollfunction whenPHP_USE_POLL_2_EMULATIONis 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