David Carlier
dedad408fe
sockets introduces socket_set_option SO_ZEROCOPY and MSG_ZEROCOPY for the socket_send* functions. it avoids copy b/w userland and kernel for both TCP and UDP protocols.
2022-07-10 20:06:52 +01:00
David Carlier
a193427333
Adds TCP_CONGESTION socket option for Linux/FreeBSD.
...
Closes #8824 .
2022-06-30 19:43:09 +01:00
David CARLIER
6b02cabc8a
Add SO_SETFIB FreeBSD socket option constant.
...
Aims to set the route table.
Closes #8742 .
2022-06-11 13:03:21 +01:00
Pierrick Charron
0e062c8af8
Merge branch 'PHP-8.1'
2022-06-09 13:51:50 -04:00
Pierrick Charron
f97a650944
Merge branch 'PHP-8.0' into PHP-8.1
2022-06-09 13:49:45 -04:00
Pierrick Charron
e2d55f2f12
Fix LONG_CHECK_VALID_INT in socket extension
2022-06-09 13:48:02 -04:00
David Carlier
d677cc13ce
Add SO_BPF_EXTENSIONS flag to socket.
...
Returns the supported bpf extensions from the kernel. Linux only.
Closes GH-8713.
2022-06-08 05:14:57 +01:00
David Carlier
6fe7ff95d9
Implements ancillary data on NetBSD.
...
With the couple LOCAL_CREDS/SCM_CREDS, in this system we get all the
infos needed (included the process id).
Closes GH-8700.
2022-06-06 23:06:01 +01:00
David CARLIER
f813520b50
Implements socket ancillary data on FreeBSD. ( #7708 )
...
using LOCAL_CREDS_PERSISTENT/SCM_CREDS2 instead so we also get the send process id.
2022-06-02 14:08:03 +01:00
David Carlier
30c8f3a80f
Fix GH-8674: sockets extension won't build for older Linux kernels
...
In abscence of the needed header, disable the feature altogether.
Closes GH-8677.
2022-06-01 17:33:36 +02:00
Christoph M. Becker
57add48777
Revert "Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt"
...
This reverts commit b0c1773686 , since
this causes CI failures, apparently related to ZTS builds.
2022-05-31 11:22:04 +02:00
Andy Postnikov
b0c1773686
Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt
...
When running in CI it fails when path/address is longer 108
Closes GH-8617.
2022-05-31 10:37:35 +02:00
David CARLIER
b14215ab6c
sockets add openbsd's SO_RTABLE option, equivalent of Linux's SO_MARK. ( #8440 )
2022-05-27 13:55:34 +02:00
David CARLIER
d1c570f48c
Sockets: add constants TCP_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT ( #8473 )
2022-05-27 13:50:32 +02:00
Ilija Tovilo
85d41da32a
Merge branch 'PHP-8.1'
...
* PHP-8.1:
[skip ci] Add NEWS entry
Fix undefined behavior in php_set_inet6_addr
Reduce the scope of XFAIL (#8592 )
2022-05-22 23:29:53 +02:00
Ilija Tovilo
7a2747ba78
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix undefined behavior in php_set_inet6_addr
Reduce the scope of XFAIL (#8592 )
2022-05-22 23:27:47 +02:00
Ilija Tovilo
f0480eb4de
Fix undefined behavior in php_set_inet6_addr
...
Postfix `++` on `NULL` is undefined behavior
Closes GH-8607
2022-05-22 23:23:47 +02:00
David Carlier
2410e378c1
Add SO_MEMINFO socket option for gathering socket related info
2022-05-20 22:06:53 +01:00
David Carlier
1f4830f21a
Add TCP_NOTSENT_LOWAT socket option
...
Can be used to limit the amount of unsent data per socket.
Closes GH-8559.
2022-05-16 16:01:38 +02:00
Christoph M. Becker
ddb04d4872
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix Solaris builds of ext/sockets
2022-03-10 14:52:48 +01:00
Christoph M. Becker
f16d35cfe9
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix Solaris builds of ext/sockets
2022-03-10 14:51:30 +01:00
David Carlier
7eb972c456
Fix Solaris builds of ext/sockets
...
We enable the proper ancillary data handling layout and API.
Closes GH-7859.
2022-03-10 14:48:08 +01:00
Christoph M. Becker
0832d4ab91
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix GH-7978: sockets extension compilation errors
2022-01-21 23:59:48 +01:00
Christoph M. Becker
943d6f642a
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix GH-7978: sockets extension compilation errors
2022-01-21 23:59:26 +01:00
David Carlier
07aaa34cd4
Fix GH-7978: sockets extension compilation errors
...
We fix the `ucred` detection when custom `CFLAGS` are in use.
Closes GH-7981.
2022-01-21 23:56:56 +01:00
Christoph M. Becker
e1a238333c
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix ext/sockets build on Haiku
2022-01-04 14:13:27 +01:00
Christoph M. Becker
623b21220b
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix ext/sockets build on Haiku
2022-01-04 14:12:56 +01:00
David Carlier
09165ace37
Fix ext/sockets build on Haiku
...
The `SOCK_RDM` datagram option is unsupported on Haiku; instead `ifreq`
has direct access to `ifr_index`.
Closes GH-7849.
2022-01-04 14:10:50 +01:00
Christoph M. Becker
3c3257b0d3
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Avoid void* arithmetic in sockets/multicast.c on NetBSD
2021-12-23 16:22:11 +01:00
Christoph M. Becker
9d2dc1e9a9
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Avoid void* arithmetic in sockets/multicast.c on NetBSD
2021-12-23 16:21:28 +01:00
David Carlier
3f0bb67361
Avoid void* arithmetic in sockets/multicast.c on NetBSD
...
On NetBSD, ifconf.ifc_buf member, unlike most of platforms, is a void
pointer.
We also fix the cpuinfo declarations with empty parameter lists.
Closes GH-7819.
2021-12-23 16:17:30 +01:00
Joe Watkins
0b5d371a9c
Merge branch 'PHP-8.1'
...
* PHP-8.1:
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:28:19 +01:00
Joe Watkins
938a81cf01
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:28:09 +01:00
David Carlier
80b02275bb
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:27:59 +01:00
Joe Watkins
fae4344ee0
Merge branch 'PHP-8.1'
...
* PHP-8.1:
socket: ancillary credentials build fix for non linux systems.
2021-12-21 07:26:46 +01:00
Joe Watkins
00113b95b2
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
socket: ancillary credentials build fix for non linux systems.
2021-12-21 07:25:55 +01:00
David Carlier
51647eb23e
socket: ancillary credentials build fix for non linux systems.
...
for systems using SO_PASSCRED sockopt flag but not using ucred struct.
2021-12-21 07:25:43 +01:00
David Carlier
3414ae6c0c
sockets: add SO_INCOMING_CPU constant
...
get/set the cpu attached to a socket, no special treatment needed,
it is simply an integer.
Closes GH-7753.
2021-12-20 14:58:09 +01:00
Dmitry Stogov
90b7bde615
Use more compact representation for packed arrays.
...
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values
Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)
TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Nikita Popov
bce040ddf2
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Set opline before calling undef op helper
Add more specific array return type hints for various extensions - part 6 (#7474 )
2021-10-07 14:40:48 +02:00
Máté Kocsis
d9e5e63032
Add more specific array return type hints for various extensions - part 6 ( #7474 )
2021-10-07 14:29:29 +02:00
Nikita Popov
d032b85762
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Use ephemeral port in test
2021-10-05 16:01:00 +02:00
Nikita Popov
e91a751e3d
Use ephemeral port in test
2021-10-05 16:00:50 +02:00
Kamil Tekiela
c3dda473cc
Fix 'can not' in test data and in code comments
2021-10-05 09:51:58 +01:00
Nikita Popov
bc19186c7f
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Use ephemeral ports in socket test
2021-09-20 10:20:10 +02:00
Nikita Popov
624848f118
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Use ephemeral ports in socket test
2021-09-20 10:20:03 +02:00
Nikita Popov
07f6c61c8e
Use ephemeral ports in socket test
2021-09-20 10:19:48 +02:00
Máté Kocsis
a1a8e9032c
Remove unnecessary PHP_FUNCTION() declarations ( #7472 )
2021-09-07 10:04:00 +02:00
Nikita Popov
768265cd22
Fix some more CLEAN sections
2021-09-06 17:03:35 +02:00
Nikita Popov
2ab4482d34
Fix some broken or unnecessary CLEAN sections
2021-09-03 10:52:30 +02:00