summaryrefslogtreecommitdiff
path: root/ext/sockets
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Nikita Popov2021-02-161-0/+1
|\ | | | | | | | | * PHP-8.0: Mark resource-like objects as non-comparable
| * Mark resource-like objects as non-comparableNikita Popov2021-02-161-0/+1
| | | | | | | | | | | | | | As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal.
* | Improve class entry generationMáté Kocsis2021-02-161-3/+2
| | | | | | | | Related to GH-6701
* | Merge branch 'PHP-8.0'Nikita Popov2021-02-162-0/+22
|\ \ | |/ | | | | | | * PHP-8.0: Fixed bug #80723
| * Fixed bug #80723Nikita Popov2021-02-162-0/+22
| | | | | | | | | | This fixes the issue just for the Socket class. Presumably we'll want to do the same for other "resource" objects.
* | Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidyMáté Kocsis2021-02-153-10/+29
| | | | | | | | Closes GH-6696
* | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | Replace zend_bool uses with boolNikita Popov2021-01-151-4/+4
| | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-142-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* | Merge branch 'PHP-8.0'Christoph M. Becker2021-01-122-3/+3
|\ \ | |/ | | | | | | * PHP-8.0: socket_create_pair() can no longer return NULL
| * socket_create_pair() can no longer return NULLChristoph M. Becker2021-01-122-3/+3
| | | | | | | | Closes GH-6592.
* | Merge branch 'PHP-8.0'Nikita Popov2021-01-121-11/+12
|\ \ | |/ | | | | | | * PHP-8.0: Use ephemeral port in socket_create_listen_used.phpt
| * Use ephemeral port in socket_create_listen_used.phptNikita Popov2021-01-121-11/+12
| | | | | | | | Avoid parallelism issues.
* | Merge branch 'PHP-8.0'Nikita Popov2020-11-302-31/+34
|\ \ | |/ | | | | | | * PHP-8.0: Use ephemeral ports in mcast_ipv*_recv.phpt
| * Use ephemeral ports in mcast_ipv*_recv.phptNikita Popov2020-11-302-31/+34
| |
* | Merge branch 'PHP-8.0'Nikita Popov2020-11-251-2/+3
|\ \ | |/ | | | | | | * PHP-8.0: sockets: Fix variable/macro name collision on AIX
| * sockets: Fix variable/macro name collision on AIXCalvin Buckley2020-11-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name "rem_size" is used by a macro in a system header on AIX, specifically `sys/xmem.h`. Without changing the name, you get the name mangled like so: ``` In file included from /usr/include/sys/uio.h:92:0, from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/socket.h:83, from /usr/include/sys/syslog.h:151, from /usr/include/syslog.h:29, from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php_syslog.h:27, from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php.h:318, from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:17: /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c: In function 'zif_socket_cmsg_space': /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token size_t rem_size = ZEND_LONG_MAX - entry->size; ^ /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected expression before '.' token /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: error: 'u2' undeclared (first use in this function) size_t n_max = rem_size / entry->var_el_size; ^ /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: note: each undeclared identifier is reported only once for each function it appears in ``` ...because of the declaration in `sys/xmem.h`: ``` ``` This just renames the variable so that it won't trip on this definition. Tested to fix the build on IBM i PASE. Closes GH-6453.
* | Merge branch 'PHP-8.0'Christoph M. Becker2020-11-126-18/+9
|\ \ | |/ | | | | | | * PHP-8.0: Strip trailing line breaks and periods from Windows error messages
| * Strip trailing line breaks and periods from Windows error messagesChristoph M. Becker2020-11-126-18/+9
| | | | | | | | | | | | | | | | PHP error messages should not contain line breaks, so we remove these from the Windows specific error messages. We also remove trailing periods for the same reason. Closes GH-6423.
* | Merge branch 'PHP-8.0'Nikita Popov2020-11-112-1/+12
|\ \ | |/ | | | | | | * PHP-8.0: Fix double free when socket_accept fails
| * Fix double free when socket_accept failsNikita Popov2020-11-112-1/+12
| |
* | Suppress bogus [-Wlogical-op] warning from GCCGeorge Peter Banyard2020-10-101-5/+1
|/ | | | | | | | | | | | See GCC bug 69602: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 which emits the warning for (errno == EWOULDBLOCK || errno == EAGAIN) which is the correct way of handling errors as the value of EWOULDBLOCK and EAGAIN is implementation defined. Therefore introduce a new macro function PHP_IS_TRANSIENT_ERROR() which handles the case when EWOULDBLOCK and EAGAIN are identical. Thanks to @twose for the idea.
* Update ext/sockets parameter namesNikita Popov2020-10-069-84/+75
| | | | | | | Also change $max_length to $length in a number of filesystem APIs, where our usage was inconsistent. Closes GH-6276.
* Promote notice to ValueError for invalid hint keyGeorge Peter Banyard2020-09-282-14/+15
|
* Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-203-16/+16
| | | | Closes GH-6173
* Run tidyNikita Popov2020-09-1843-93/+93
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Display types in stubs more uniformlyMáté Kocsis2020-09-162-2/+2
| | | | | | In preparation for generating method signatures for the manual. This change gets rid of bogus false|null return types, a few unnecessary trailing backslashes, and settles on using ? when possible for nullable types.
* Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-091-1/+1
| | | | Closes GH-5999
* Fix Windows build for shared ext/socketsChristoph M. Becker2020-09-082-4/+17
| | | | | We can't use `PHPAPI` for extensions which may be built shared. Thus, we introduce `PHP_SOCKETS_API`.
* add socket_ce and socket_import_file_descriptor in public APIRemi Collet2020-09-081-6/+4
|
* Fix UNKNOWN default values in various extensionsMáté Kocsis2020-09-072-6/+6
| | | | Closes GH-6075
* Merge branch 'PHP-7.4'Nikita Popov2020-08-262-4/+4
|\ | | | | | | | | * PHP-7.4: Avoid socket path clash in test
| * Avoid socket path clash in testNikita Popov2020-08-262-4/+4
| |
* | Don't check specific message in socket_shutdown.phptNikita Popov2020-08-101-1/+1
| |
* | Only test one error in socket_strerror() testNikita Popov2020-08-101-142/+10
| | | | | | | | | | The messages differ by used libc and version, so let's not try to do exhaustive testing here.
* | Add many missing closing PHP tags to testsMáté Kocsis2020-08-0942-0/+42
| | | | | | | | Closes GH-5958
* | Add more argument types to stubsMáté Kocsis2020-08-072-1/+2
| | | | | | | | Closes GH-5943
* | Normalize error message capitalizationNikita Popov2020-08-052-2/+2
| |
* | Merge branch 'PHP-7.4'Nikita Popov2020-08-052-8/+22
|\ \ | |/ | | | | | | * PHP-7.4: Fix memory leak on socket_sendmsg() / socket_recvmsg() error
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-052-8/+22
| |\ | | | | | | | | | | | | * PHP-7.3: Fix memory leak on socket_sendmsg() / socket_recvmsg() error
| | * Fix memory leak on socket_sendmsg() / socket_recvmsg() errorNikita Popov2020-08-052-8/+22
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-051-5/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Unset ai_canonname field in dump
| * | Unset ai_canonname field in dumpNikita Popov2020-08-051-5/+5
| | | | | | | | | | | | | | | | | | Okay, looks like ai_canonname does not get set on macos even if AI_CANONNAME is specified, so canonicalize this in the other direction instead and unset ai_canonname if it is present.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-052-1/+8
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * PHP-7.4: Check ps -p availability in proc_nice test Set AI_CANONNAME flag in socket_addrinfo test Add ipv6 skipif to test Improve privilege check in pcntl_setpriority() test
| * | Set AI_CANONNAME flag in socket_addrinfo testNikita Popov2020-08-051-1/+4
| | | | | | | | | | | | | | | Musl always populates ai_canonname. Set the flag to avoid output discrepancies.
| * | Add ipv6 skipif to testNikita Popov2020-08-051-2/+6
| | | | | | | | | | | | | | | This was done for the -unix variant, but not the (formerly windows-only?) main test.
* | | Fix Socket related tests on WindowsMáté Kocsis2020-08-043-21/+22
| | |
* | | Fix Windows buildChristoph M. Becker2020-08-041-2/+2
| | |
* | | Convert resources to objects in ext/socketsMáté Kocsis2020-08-0335-530/+617
| | | | | | | | | | | | Closes GH-5900.
* | | Fix #79923: fix socket_set_option_bindtodevice testSantiago M. Mola2020-08-034-6/+6
| | | | | | | | | | | | Closes GH-5924.